It makes refactoring harder, might confuse new developers, and static analysis gets harder as well. In case you are not familiar with that, SOLID is an acronym that stands for: In addition, when putting such methods on your model, you are violating the S of SOLID. When you use Eloquent, your models have multiple responsibilities. It holds the data from your database, which is what models usually do, but it also has filtering logic, maybe sorting and even more in it. Laravel comes with quite a few global helper functions. They seem very handy and yes, they are handy. You just have to know that you sacrifice your independence for that handiness and your global namespace gets polluted. collect() - This creates a new instance of the Collection class.app() - huh? We don’t need this method.app_path() - why? If you need the path of the app, ask the app object.Here’s a list of three helper methods that we have but don’t need since there are better alternatives: It rarely leads to conflicts, but avoiding that altogether should be preferred.
We can just new an object up by ourselves.