Answer the question
In order to leave comments, you need to log in
Is it possible to make relative paths in Laravel?
There is a site. Laravel is located in the / sub folder. Those. index.php is in /sub/public.
For routes to work, you need to write
$app->get('sub/public', function () use ($app) {
return $app->version();
});
$app->get('/', function () use ($app) {
return $app->version();
});
Answer the question
In order to leave comments, you need to log in
$router->group(['prefix' => 'sub'], function ($router) {
$router->get('public', function ($router) {
return $router->version();
});
});
The Route::get('/') route just points to the public folder of the Laravel project.
That is, in nginx (or whatever you have) you specify the site root as .../sub/public and everything works.
Or did I misunderstand the question?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question