Design Pattern: how do you structure your Eloquent models?
Hello,
My models can become quite big and less readable as they hold many things, including static repo-like functions (as Laravel don't use repositories, I don't really either even if I probably could), relations, scopes, custom functions, accessors and mutators.
I was wondering if splitting the code (How? Traits?) would help or it would become difficult to know where the data comes from...
I don't really know if there are other good options/patterns than the all-in-one model that we often see in Laravel. Have you ever structured your models differently?
I am also starting to look at splitting my rather large monolithic application into individual packages to reduce complexity. The documentation seems straight-forward and I think this is a good path but only time will tell! Automatic Service Provider registration looks like it could help make a modular system