By default, Laravel project is run from the public directory. For this, I must enter http://localhost/public/.
How do I configure Laravel so that the website will appear to be from http://localhost/?
By default, Laravel project is run from the public directory. For this, I must enter http://localhost/public/.
How do I configure Laravel so that the website will appear to be from http://localhost/?
•Go to mainproject/public>>
a. .htacess
b. favicon.ico
c. index.php
d. robots.txt
e. web.config
1.cut these 5 files from the public folder, and then paste on the main project folder that’s means out side of public folder… mainproject/files
2.Next after paste ,open index.php ,modify
•require __DIR__.'/…/bootstrap/autoload.php'; to
•require __DIR__.'/bootstrap/autoload.php';
modify
$app = require_once DIR.'/../bootstrap/app.php'; to
$app = require_once DIR.'/bootstrap/app.php';
you can also watch this video for better understanding----------------
Setup your webserver (probably Apache or NginX) to use the public folder of your laravel app as root directory. Or use a public_html
folder and symlink it to your public folder, which basically does the same.
open your project in visual studio code
in new terminal type
php artisan serve
and goto http://127.0.0.1:8000