如何对路由进行分组


Route::group(['controller' => [AdminController::class], 'middleware' => ['role:administrator']], function () {
Route::get('/admin', 'index');
});

它不识别AdminController

Route::controller(AdminController::class)
->middleware('role:administrator'))
->group(function () {
Route::get('/admin', 'index');
});

关于路由控制器组的更多信息,请参见https://laravel.com/docs/9.x/routing#route-group-controllers

相关内容

  • 没有找到相关文章

最新更新