23
What are the advantages of Repositories in Laravel? It seems to be abstracting the Model layer from the business logic of the application. Although it really just seems to make the whole request life cycle just that much more complicated for little gain.
Can someone shed light on the advantage of Laravel repositories?
Edit
After now using repositories for some time I would add the following:
- Repositories enforce single responsibility
- Repositories should only return one collection of entities
- Although separate from dependancy injection the concepts are brothers
- Storage abstraction for the actual storage implementation (e.g. MySQL)
- Easier testing