bitfumes / laravel-multiauth

Multi Auth and admin auth in Laravel Project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding multiple roles in a middleware

helioswansway opened this issue · comments

commented

Hi,

How can I add multiple roles in a middleware i.e:

Route::group([
    'prefix'     => '/brands',
    'middleware' => ['role:super-admin, admin']
    ], function(){
    Route::get('/', 'Admin\BrandController@index')->name('brand.index');
});

This is possible in the blade files like so @admin('emails,super-admin'), but I don't seem to be able to recreate in the routes.

Any help is much appreciated.

Thanks in advance.

You mean multiple role in route middleware ?

commented

Yes! I've tried everything but I don't seem to find a solution without assigning the roles to the user - I would rather assign multiple roles to the route if that's possible.

Thank you so much.

Solved in new version 3.0.0 :)