Answer the question
In order to leave comments, you need to log in
How to use resource for different user roles?
There is a resource, inside the middleware (role check):
Route::group(['middleware' => ['role:creator,viewer']], function() {
Route::resource('passports', 'PassportsController');
});
Route::resource('passports', 'PassportsController', [
'middleware' => 'role:creator'
]);
Route::resource('passports', 'PassportsController', [
'middleware' => 'role:viewer'
])->only(['index', 'show']);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question