Shivamyadav's avatar

Need a suggestion on using Repository in laravel

Just need your opinion Does It's worth ?

0 likes
4 replies
Snapey's avatar

You just end up replicating Eloquent functions.

2 likes
kevinbui's avatar

The repository pattern can be substituted by query scopes.

There was a hot debate on this forum about whether to use the repository pattern or not in Laravel. The outcome is not to, I cannot find the link.

This matter was discussed a bit on this Full Stack Radio episode.

2 likes
GdS's avatar

I agree with both answers above. That pattern is not worth when you have eloquent models.

I would prefer tappable scopes, it's a very flexible approach and it suits my mindset.

1 like

Please or to participate in this conversation.