DEV Community

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

Collapse
 
miguelf11 profile image
Miguel Figueira • Edited

This is awesome, thanks for sharing!

But I have a doubt, How you define scopes in the repository?
Or how to reuse some queries to emulate the use of scopes, I want to define this scopes inside the repository :)

Collapse
 
mratiebatie profile image
Sjors van Dongen

Thanks for your positive comment :) Unfortunately, it's currently not possible to put your scopes in your repositories. What you could do for now is put your scopes in a separate trait and include them in your model.