dimanche 22 novembre 2020

Laravel Apply middlware on specific route of resource route controller

I want to apply middleware on create route of resource controller but confused how to set middleware. Normally we can add middleware like this

Route::get('api/users/{user}', function (App\Models\User $user) {
    return $user->email;
})->middleware('name');

but when we have a resource controller so how could I apply middleware on single route of resource controller.

Route::resource('front-pages','Admin\FrontPagesController');


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3lXREHQ
via IFTTT

Aucun commentaire:

Enregistrer un commentaire