Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jmagnuss's avatar

Laravel best practices for real-world app architecture

I build or maintain on multiple Laravel projects for different companies, and as they grow I end up being unhappy with the size of the Controllers, so I'm reading up on Domain Driven Design, and the general preference for Fat Model, Thin Controller.

HOWEVER

  1. That preference seems simplistic and outdated (per @JeffreyWay on twitter). instead it's more like "Many small business classes, thin everything"?
  2. This StackOverflow answer gives a great breakdown of app organization, from model to repository to [...] to controller to view, but kind of skips the middle where you DO THINGS using your models before returning to the controllers.
  3. The recommended books Laravel: from Apprentice to Artisan and Implementing Laravel are 4+ years old now.

I'm steeped in old school GOF patterns and refactoring, so I know how to implement factories, repositories, and builders in classes I could throw in the app directory alongside my models, but this seems messy.

I'm craving:

  • authoritative best practices for L5 project architecture that go beyond "posts and comments" examples
  • recommendations on where to locate business logic between models and controllers in a Laravel-ey way

Point me at resources! Make suggestions! Let me know what key Laracast video or book I've missed!

Many thanks, LC community.

0 likes
2 replies
topvillas's avatar

Well there's the problem with DDD, it's not orientated to technical considerations. I feel your pain, I've been struggling with the ideas it presents and how to implement them myself.

If you'd like a nicely organised way to structure your app in a DDDish way. You could do worse that looking at the Lucid Architecture.

https://github.com/lucid-architecture/laravel

https://www.youtube.com/watch?v=wSnM4JkyxPw

We've used it for a recent project and it worked out quite well.

1 like

Please or to participate in this conversation.