I am working on a Laravel application with many Eloquent Models. These eloquent models (e.g. User, Post, etc) also contain a lot of queries that are only loosely connected to the model (often raw sql).
Some queries are like, 'get me some information from one table, some of another and a little of info from a third table'. Now models like the User model can have a lot of methods like getAllUncompletedActionsForUser
or getSessionsDurationsPerUser
. I think it is not nice if an eloquent model will have a thousands lines of code.
What would be your take on splitting these models, where would you put and how would you name classes that return database results that deal with many different tables?
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2k2krA8
via IFTTT
Aucun commentaire:
Enregistrer un commentaire