vendredi 3 mai 2019

Laravel middleware multi roles routing

I have problem to make routing with middleware multi roles I have tried some in internet but still wont work

I have 3 roles, superadmin, admin and member I want the superadmin and admin can access the add page

here is my code :

Route::group(['prefix' => 'staff', 'middleware' => 'auth'], function () {

Route::GET('/add', [
    'uses'       => 'StaffController@page_add',
    'middleware' => 'rule:superadmin', ???
]);

});

I have tried to put 'middleware' => 'rule:superadmin|rule:admin' but wont work

thank you



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2V0Qltn
via IFTTT

Aucun commentaire:

Enregistrer un commentaire