Laravel 5.1应用程序没有任何路由

问题描述 投票:0回答:1

我创建的路线很少,但不显示任何路线。Code dislpayed

php laravel-5 laravel-5.1
1个回答
0
投票

首先,请确保在您的RouteServiceProvider中加载了routes.php文件。您应该在其map()方法中看到以下内容:

public function map(Router $router)
{
  $router->group(['namespace' => $this->namespace], function ($router) {
    require app_path('Http/routes.php');
  });
}

第二,您已启用路由缓存,可能是在<< routes.php上添加任何路由之前,您已经缓存了空的路由列表,而现在正在重用缓存的版本。运行php artisan route:clear,然后运行php artisan route:list-如果是这个原因,您应该看到所有新路径。

© www.soinside.com 2019 - 2024. All rights reserved.