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
That preference seems simplistic and outdated (per @JeffreyWayon twitter). instead it's more like "Many small business classes, thin everything"?
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.
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!
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.