Code Monkey home page Code Monkey logo

Comments (5)

JohnnyWalkerDigital avatar JohnnyWalkerDigital commented on July 30, 2024 4

My opinion: The repository pattern is the devil and should be avoided. It's taking SOLID to unnecessary levels with an ORM framework. Otherwise just store interfaces in Contracts/

from laravel-best-practices.

carlos-mora avatar carlos-mora commented on July 30, 2024 2

We need more than "I like it". In general there is a significant positioning against repositories in Laravel, mainly because it relies in an Active record pattern, and its advantages are lost when Models are isolated in Repos.
In terms of Models, Laravel's style mean the use of Concerns to compose behavoir. That means that every functionality should also be exposed explicitly in Repos, what makes things complex.

from laravel-best-practices.

jocelinkisenga avatar jocelinkisenga commented on July 30, 2024 1

but for me, i like using repo than interfaces

from laravel-best-practices.

spekulatius avatar spekulatius commented on July 30, 2024 1

Hello everyone,

adding my 2-cent to the discussion about repo patterns:

From working on a larger, aged applications with repos, the repos didn't add much benefit IMHO. The repo pattern seems to work better for frameworks without strong ORM or even completely without any ORM. With Laravel most of the value from repos comes from abstracting a few setters/getters away and being more DRY. The setters and getters are covered with Eloquent pretty good already I think. The DRY part can easily achieved with an actions nicely I would argue. Can you share where you see the advantages @jocelinkisenga?

Cheers,
Peter

from laravel-best-practices.

jocelinkisenga avatar jocelinkisenga commented on July 30, 2024

how that things can get complex? give your real example of using repo pattern

from laravel-best-practices.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.