DEV Community

Discussion on: The best Laravel repositories solution in 30 lines of code

Collapse
 
mratiebatie profile image
Sjors van Dongen

Scopes are a good way to create custom query functions indeed. Still, I don't think this should be part of an instance of a Product entity though. When an instance of a Product has a method called 'findByName' it is in the wrong place in my opinion.