Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Laravel Valet use any folder as public

If you've used Valet, you know you have to put your assets in a folder called "public" for it to serve your site or app properly. My host requires that I put my public assets in a folder called "public_html". Some people aren't able to change this without the help of their host. Or maybe you can, but this is much easier!

So, here's the tip.

Use whatever name you want for your public assets folder. (In my case, "public_html"). In Terminal, make sure you are in your project root directory Create a symlink to that folder: ln -s /Your/Path/To/public_html public And you're done! Valet will now see the "public" symlink and serve your site without a hitch.

Hint: You'll probably want to add the new public folder to your .gitignore file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment