DEV Community

Discussion on: Implement CRUD with Laravel Service-Repository Pattern

Collapse
 
lokesh7186 profile image
Lokesh Tulsani

I think the service layer is enough for the CRUD operation here and Repository is not at all required since you’re only abstracting Eloquent queries inside the repository.

Also a repository is nothing more than an adapter for a specific persistence and it should not implement any business logic nor application logic.

Collapse
 
safventure11000 profile image
Saf11000

Hi,

Thanks for sharing your input. For the purpose of showing the flow of the pattern, I’m using a simple CRUD. Separating the wrapper of the model and business logic is useful if you’re working in a big team or big projects.

Some comments have been hidden by the post's author - find out more