re: I'm a full stack web developer. Ask Me Anything! VIEW POST

TOP OF THREAD FULL DISCUSSION
re: How do you feel about Eloquent as well as Collections in Laravel? I'm not a fan. Also more importantly, how many Lowe's could Rob Lowe rob if Rob L...
 

Eloquent is probably one of the most powerful features of Laravel. It’s good, to an extent. I think that people certainly over use it and add business logic into models, but they should instead go into separate classes. I also don’t think that eloquent models should be used directly, instead they should be handled by repositories. The one thing I do like eloquent for is the relationships and the query scopes.

With collections, I find these useful from time to time - depending upon my use case. If I need to do some complicated operations on an array of data, filtering and sorting it is easier and clearer for any other developers to know what is happening.

I think it all comes down to personal preference and using the right tool for the use case.

code of conduct - report abuse