blog-contest-may-mayhem icon indicating copy to clipboard operation
blog-contest-may-mayhem copied to clipboard

How to implement repository pattern in Laravel

Open alvibd opened this issue 7 years ago • 2 comments

https://medium.com/@alviahmed/how-to-implement-repository-pattern-in-laravel-d599904d1f61

alvibd avatar May 29 '18 04:05 alvibd

Imagine you have created a controller that does no logic and just redirects to some other controller? This is essentially the same as what you did with this "repository" class.

crnkovic avatar May 29 '18 11:05 crnkovic

@crnkovic repository classes usually are meant for respective single model. It's unlikely that you will have to work on a single model in a controller all the time as a model often has many dependencies through relationships

alvibd avatar May 29 '18 12:05 alvibd