如何更改laravel中路由系统使用的基本路径


How change the base path use by the routing system in laravel

我是Laravel的新手,我开始设置我的路线。我在本地wamp服务器上使用laravel 5.1。

我在当地,http://localhost/ttt/在Laravel的CCD_ 1目录上。

当我尝试这个:

Route::get('admin',function(){
    echo 4;
});

然后转到http://localhost/ttt/admin,我有一个错误,但当我这样做时:

Route::get('ttt/admin',function(){
    echo 4;
});

它起作用。我检查了配置并更改了config/app.php中的url值,但它不起作用。

你知道路由器是否使用了一种我可以配置的路径吗?

您可以prefix初始路由组中的每条路由,

应用程序''提供商''RouteServiceProvider@map

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