How to Remove public from url laravel framework 5.x

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’;

 

 

 

 

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *