alexeymezenin / laravel-best-practices

Laravel best practices
11.24k stars 2.37k forks source link

fixed more readable #168

Open hareom284 opened 1 year ago

JohnnyWalkerDigital commented 1 year ago

👎 Using the repository pattern with Laravel goes against its core ORM design

JohnnyWalkerDigital commented 1 year ago

I think It it better approach

This is a good explanation as why it's not a good idea in 99.9% of Laravel projects

https://www.youtube.com/watch?v=giJcdfW2wC8

carlos-mora commented 1 year ago

In the context of Laravel, Repository provides the very same functionality and isolation than Eloquent Models do. Using it is duplicating behavior already present, and screwing up all the convention provided by an standard tool like Eloquent and the framework itself. Everybody knows Eloquent, it has a CONVENTION that a Repository will provide BY CONFIGURATION, following its own standards.

carlos-mora commented 1 year ago

I think It it better approach

What are you approaching to? :) Can you explain your POV?