DEV Community

Nguyen Hoang
Nguyen Hoang

Posted on

Repository vs service design pattern

Repository design pattern: use to call model - eloquent - CRUD,
Ex:

  • saveMessage
  • deleteMessage
  • ....

Service design pattern: call to Repository (many)
Ex:

  • transaction is place here
  • if service is complicated -> create small service

Top comments (0)