How to Remove public from url laravel framework 5.x
- Create a DIR in your laravel app root and name it “myapp”, you can name it anything you like.
- Move everthing except public DIR from your root directory to newly created DIR “myapp”
- Move everthing from public DIR to root, now public folder will become empty.
- Your root structure will become like attached image.
- Edit your index.php as below:
- change require __DIR__.’/../bootstrap/autoload.php’; to require __DIR__.’/myapp/bootstrap/autoload.php’;
- Change $app = require_once __DIR__.’/../bootstrap/app.php’; to $app = require_once __DIR__.’/myapp/bootstrap/app.php’;
![](https://i0.wp.com/localhost/mistersuraj-wp/wp-content/uploads/2017/01/remove-public-from-url-laravel-framework-5-x.png?resize=480%2C232)
Leave a Reply