search

Home  >  Q&A  >  body text

php - Laravel warehouse mode solved!

高洛峰高洛峰2694 days ago801

reply all(2)I'll reply

  • 漂亮男人

    漂亮男人2017-06-30 09:56:09

    Personally, I feel that the warehouse model mentioned in various laravel tutorials on the Internet is only suitable for encapsulating some complex query operations, and is useless for others. The complete warehouse model needs to cooperate with the domain model. In laravel, the model cannot play the role of the domain model. Moreover, there is basically no decoupling operation between the warehouse and Laravel's own ORM, so it is of little significance to define an interface for the model.

    Of course, these are just personal understandings, and discussion is welcome. Still need to learn relevant knowledge about domain-driven design

    reply
    0
  • PHP中文网

    PHP中文网2017-06-30 09:56:09

    Not going to discuss this warehouse pattern, the interface should be injected into the controller constructor part of your code

    reply
    0
  • Cancelreply