Laravel framework is awesome to use. But for beginners, it might be irritating to fix the issue where user needs to goto
/public file to access newly created project. If that is your case, well, you are at right place.
The process is very simple with only 2 steps. Here are the steps.
- Goto to your laravel root folder of your project and you will find
- Now goto
/publicfolder and find
.htaccessfile. If you don’t find
.htaccessfile, it means you have turned off
show hidden filesetting in your computer. Here is steps on how to show hidden files.
- Mac users:
Command+Shift+.and you will be able to see all hidden files.
- And if you want to hide again, Please the same keys and you are done. So easy.
- Windows users:
Hidden itemsAnd you are good to go.
- Mac users:
- Copy the
/publicfolder to your Laravel root folder.
- Now open your website
localhost:8888/your_project. Isn’t is working now? I hope so.
This way, you can enable accessing your website directly from your root folder instead of typing
/public which doesn’t even look better for the website. I hope once day Laravel team will do the changes within its framework without need to do anything at first place. But till that time, well here is the solution for you guys.
I hope, this helped you. If so, don’t forget to share and it would be highly appreciated if you give a like for this post. Let me know if you have problem. I will be happy to help you.