缺少必需的参数“$routes”

时间:2021-01-06 19:10:56

标签: laravel laravel-5

在此代码中,我在 Laravel 5.5 中有一个警告:

Route::prefix('dashboard')->group(function () {

 Route::get('/', function () {
    return 'index';
  });

 Route::get('/menu', function () {
    return 'menu';
 });

});

我有这个警告:

缺少必需的参数“$routes”

1 个答案:

答案 0 :(得分:0)

请使用此组路由前缀

Route::group(['prefix' => 'dashboard','as'=>'dashboard.'], function () {

 Route::get('/', function () {
    return 'index';
  });

 Route::get('/menu', function () {
    return 'menu';
 });

});

运行

php artisan route:cache

并查看路由列表运行此命令

php artisan route:list