Skip to content

Instantly share code, notes, and snippets.

@gradosevic
Last active December 29, 2020 08:40
Show Gist options
  • Save gradosevic/abd2ef1666d9c876886f7f68111432da to your computer and use it in GitHub Desktop.
Save gradosevic/abd2ef1666d9c876886f7f68111432da to your computer and use it in GitHub Desktop.
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