How to change base path usage by laravel routing system

I am new to Laravel and I am starting to set my routes. I am using laravel 5.1 on a local Wamp server.

I am on local, http: // localhost / ttt / continues /publicthe Laravel directory.

When I try this:

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

and go to http: // localhost / ttt / admin , I got an error, but when I do this:

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

It works. I check the configuration and change the value urlin config/app.php, but it does not work.

Do you know if there is some way used by the router that I can configure?

+4
source share
1

prefix ,

App\Providers\RouteServiceProvider @

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

Source: https://habr.com/ru/post/1617518/


All Articles