我有3种用户
我在/app/Http/Middleware
创建了3个中间件
我把它们命名为
我已经在/app/Http/Kernel.php
注册了
'admin' => 'App\Http\Middleware\AdminMiddleware',
'admin-super' => 'App\Http\Middleware\AdminSuperMiddleware',
'admin-readonly' => 'App\Http\Middleware\AdminReadOnlyMiddleware',
我已尝试在 routes.php
中调用它们 $router->group(['middleware' => ['auth', 'admin-super'] ], function() {
Route::get('account','AccountController@index');
Route::post('account/store','AccountController@store');
Route::post('/view-profile/logo/update', 'ProfileController@updateLogo');
});
$router->group(['middleware' => ['auth', 'admin'] ], function() {
Route::get('account','AccountController@index');
Route::post('account/store','AccountController@store');
});
$router->group(['middleware' => ['auth', 'admin-readonly'] ], function() {
Route::get('account','AccountController@index');
});
结果
当我以user type == admin
登录并转到:
我一直得到404.
我错过了什么吗?
对此的任何提示/建议将不胜感激!
答案 0 :(得分:0)
将执行第一条匹配路线。