If you're using Laravel on a hosting service that doesn't allow changing the document root, you'll encounter the issue of having /public
in your URLs.
To resolve this issue, create an .htaccess file and add the following directives:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ /public/$1 [L,QSA]
</IfModule>
No additional configuration is required.