I am using Laravel Spatie package and I have inserted all the permissions that I want and an Admin Role.
What I am trying to do:
I am trying to check in each route whether user is an admin (can do ANYTHING) or not an admin and has a certain permission.
What I have tried:
I have tried to add |
sign.
// GET ALL SEASONS
Route::get('/', 'SeasonsController@index')
-> name('index')
-> middleware(['role:admin|permission:seasons show active']);
What happened VS expected behavior:
Whenever I log in with a user that has seasons show active
permission I get 403 Forbidden
.
But if I removed role:admin
the user get the permission.