Route::get('admin/dashboard', function () {
return 'Welcome to admin page';
})->middleware('isAdmin');
Route::get('supervisor/dashboard', function () {
return 'Welcome to supervisor page';
})->middleware('isSupervisor');
// I want this route to become admin/supervisor role
Route::get('roles/dashboard', function () {
return 'Welcome to admin/supervisor page';
})->middleware('isAdmin')->middleware('isSupervisor');
Route::get('/home', 'HomeController@index');
Please help thanks !
Simply pass an array to the middleware method:
Route::get('...', function() {
return '...';
})->middleware(['middleware1', 'middleware2']);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community