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.
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
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.
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.