bitfumes / laravel-multiauth

Multi Auth and admin auth in Laravel Project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't define more than one role in route middleware

fatehalrabeai opened this issue · comments

Describe the bug
I can't add more than one role in route middleware . I followed the instructions in the documentation
as follows :
Route::get('admin/check',function(){
return "This route can only be accessed by admin with role of Editor"
})->middleware('role:editor;publisher');

What the middleware accept only one role and it fails if I add more than one role.
Laravel Version
Which laravel version you are using
I'm using laravel 6.2 .
To Reproduce
Steps to reproduce the behavior:

  1. add more than one role and new admins and link those admins to different roles .

  2. add new route with middle-ware contains more than one role .
    Route::resource('/dashboard','\App\Http\Controllers\Admin\DashboardController')->middleware('role:super;orders;places');

  3. After you login it accepts only one role otherwise it redirects you to home and can't logout or do anything.

Route middleware should accept more than one role as described in the documentation and login to the route specified .

Desktop (please complete the following information):

  • Browser .chrome, firefox