登录后,它无法使用自动重定向角色。
Route::group(['middleware' => 'auth'], function () {
/*Route::get('/', function () {
return view('general');
});*/
Route::resource('users', 'UserController');
Route::get('/admin', [
'as' => 'admin.index',
'middleware' => 'role:admin',
'uses' => function () {
return view('admin.index');
}
]);
Route::resource('roles', 'RolesController');
Route::get('/general', [
'as' => 'general.index',
'middleware' => 'role:general',
'uses' => function () {
return view('general.index');
}
]);
});