How organize big projects in Laravel?

  • Introduction
  • What’s HMVC?
  • Advantages of using HMVC?
  • What’s wrong with the MVC pattern?
  • Let’s know how we can use the HMVC pattern in Laravel!
  • Pros
  • Cons
  • Best Packages that generate modules and implement that approach
  • Conclusion

Introduction

  • How can I make organized the project well to be easy for me or for any other developer easy to understand for example if you’re looking for a file in a big project, you want to be easy to find that file, right?

What’s HMVC?

Advantages of using HMVC?

  • HMVC supports the reuse of code
  • HMVC allows easy distribution of MVC entities stored in a single directory.
  • HMVC reduces dependencies and allows to easily extend applications while retaining ease of maintenance.
  • Testing is easier because the system is divided to a large extend into independent parts.

What’s wrong with the MVC pattern?

Let’s know how we can use the HMVC pattern in Laravel!

Pros

  • Modularization: reduction of dependencies between the disparate parts of the application.
  • More organized: having a folder for each of the relevant triads makes for a lighter workload.
  • Reusability: by the nature of the design it is easy to reuse nearly every piece of code.
  • Extendibility: this makes the application more extensible without sacrificing ease of maintenance.

Cons

Best Packages that generate modules and implement that approach

Laravel Modules

  • Is a Laravel package that was created to manage your large Laravel app using modules.
  • This package just structures your project (Modules) and doesn’t provide any implementation.

Laragine

  • is a Laravel package that was created to manage your large Laravel app using modules also but here’s a difference, this package implements all API CRUD operations with unit tests, the package generates (Controller — Model — Factories — Migrations — unit tests — etc..), all you need to do to just add your API route in your route folder and everything (APIs CRUD operations) will work magically sounds interesting, right!
  • check this video to know more.
  • I wrote a series of blogs about it on the dev website
  • Check the documentation

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abdlrahmansaber

Abdlrahmansaber

Software engineer, Problem solver, Geek.