Laravel 5 Remove public from URL : We need to remove the public from url in laravel. Here in this tutorial we are going to explain how to remove public from url in laravel.
Laravel 5 Remove public from URL
You can remove the public from url simply as –
- Step 1: Copy index.php and .htaccess from the public folder –
- Step 2 : Paste these file to the root folder.
- Step 3 : Now open index.php and change the following lines –
require __DIR__.'/../bootstrap/autoload.php';
to
require __DIR__.'/bootstrap/autoload.php';
And
$app = require_once __DIR__.'/../bootstrap/app.php';
to
$app = require_once __DIR__.'/bootstrap/app.php';
- Step 4 : Flush all cache and delete cookie.
Thus the above solution will remove the public from url in laravel