Changing Laravel’s default public directory

Sometimes on the servers I work on I need to change the “public” directory to “content.” To do this I create my own “Application.php” class, extending Laravel’s Application class and override the publicPath method.

Next, I update bootstrap/app.php and create the $app instance using my Application class.

I don’t use server.php but, if you did, you’d need to update the following lines in your public directory’s index file too: