re: Laravel Repository Pattern VIEW POST

re: When people advocate for repositories pattern they often say "what if I want to change data storage from MySQL to something else". And it always ma...

"To change data storage" - is not the main aim of Repository.
The main aim is to have separate layers and clean code. It becomes much easier to make scalable code, cover it by tests if you are going this way. But it makes sense to use repositories and follow the best practices of clear code if you are developing big enterprise applications.
For RAD the ActiveRecord (Eloquent) is the best

But, in the current article author suggests using Eloquent Models with Repository. It is not the best way and it will be better to use or AR or Repo. Otherwise, you will lose all the benefits of both ones.

code of conduct - report abuse