Open atefehkianfar1 opened 5 years ago
In Route : You can add parameter to your middleware separated by colon and also use comma for multiple parameter Route::resource('admin', 'AdminController')->middleware('roles:Admin,Author');
In Middleware : To use in middleware add parameter to handle function. If you want multiple parameter(array) use 3 dots public function handle($request, Closure $next, ...$role)
Hello there, I used this code for a project in Laravel 5.3 last year now I want to use it in Laravel 5.7 but it won't work actually I think it won't support defining the routes like this : Route::get('/productRequestFollow',[ 'uses'=>'RequestController@productRequestFollowGet', 'middleware' => 'roles', 'roles'=>['supplierManager','unitManager','user','systemManager'] ]);