我是Laravel的新人,我开始设置我的路线。我在本地wamp服务器上使用laravel 5.1。
我在本地,http://localhost/ttt/访问Laravel的/public
目录。
当我尝试这个时:
Route::get('admin',function(){
echo 4;
});
然后转到http://localhost/ttt/admin,我收到错误但是当我这样做时:
Route::get('ttt/admin',function(){
echo 4;
});
有效。
我检查了配置并更改了url
中的config/app.php
值,但它不起作用。
你知道我可以配置路由器使用的路径吗?
答案 0 :(得分:1)
您可以prefix
初始路线组中的每条路线
应用\提供商\ RouteServiceProvider @地图:
$router->group(['prefix' => 'ttt', 'namespace' => $this->namespace], function ($router) {
require app_path('Http/routes.php');
});