mercredi 19 août 2020

Laravel Routes and middleware

I have a middleware copied from `https://ift.tt/2YdPqdG

Route::get('user/{user}', [
 'middleware' => ['auth', 'roles'],
 'uses' => 'UserController@index',
 'roles' => ['administrator', 'manager']
]);

My routes

how do I add the roles to the resources

Route::resource('user','UserController')->middleware(['auth','roles']);;


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire