Understanding Laravel: A Guide to Structuring Folders for Optimal Organization

Naufal Fadhil Athallah
2 min readNov 30, 2024

--

Photo by Brett Jordan on Unsplash

Laravel

Laravel is a powerful framework for the PHP programming language. It is widely used by developers around the world for its ability to streamline the application development process and accelerate project timelines. One of Laravel’s key features is its well-organized folder structure, which provides a foundation for managing files efficiently.

However, Laravel’s folder structure can initially seem overwhelming due to its complexity. While I won’t go into detail about the specific purpose of each folder in this article, I aim to share insights on how to create a well-structured folder organization in Laravel projects. This will not only help you maintain clean and efficient code but also make your project easier to navigate for you and your team.

The Structured of Laravel Projects

- app/
- Http/
- Controllers/
- Models/
- Providers/
- bootstrap/
- config/
- database/
- factories/
- Controllers/
- migrations/
- seeders/
- node_modules/
- public/
- build/
- templates/
- resources/
- css/
- js/
- views/
- components/
- dashboard/
- header.blade.php
- navigation.blade.php
- script.balde.php
- mail
- header.blade.php
- greeting.blade.php
- footer.blade.php
-
modal.blade.php
- primary-button.blade.php
- 404.blade.php
- etc..
- layouts/
- dashboard/
- landing-page/
- authentication/
- etc..
- pages/
- dashboard/
- admin/
- dashboard/
- generate-invoice/
- parameter/
- user/
- dashboard/
- exam-history/
- invoice/
- general/
- invoice/
- landing-page/
- authenticatin/
- etc..
- routes/
- storage/
- app/
- framework
- logs
- psil
- tests/
- Feature/
- Unit/
- Pest.php
- TestCase.php
- vendor/
- .env
- .env.example
- .gitattributes
- .gitignore
- etc..

In Below is a list of folders that you might consider for your projects, with bolded sections representing new folders that can be added to better suit your project’s needs. You can adjust these folders according to your specific project requirements.

If I make any updates or modifications to the structure in the future, I will ensure this guide is edited accordingly.

Edited history:

Release: "2024–11–30"

Thanks.

--

--

Naufal Fadhil Athallah
Naufal Fadhil Athallah

No responses yet