1/7
This example is a Todo service for the Todo model. You can write any function that deals with todos, such as:
- Creating a new one
- Returning every todo that due today
- Deleting a todo (it can be more complex than a one-liner you know)
This example is a Todo service for the Todo model. You can write any function that deals with todos, such as:
- Creating a new one
- Returning every todo that due today
- Deleting a todo (it can be more complex than a one-liner you know)
6/7
In general, services provide you a great way to:
- Unload some logic from the controllers
- Extract out re-usable pieces of code
- Structure your code in a good way
In general, services provide you a great way to:
- Unload some logic from the controllers
- Extract out re-usable pieces of code
- Structure your code in a good way
7/7
However, I personally like Actions better in larger applications.
If you’re interested in this topic subscribe to my DDD newsletter where I discuss these concepts. One e-mail every Wednesday until I finish the course I’m working on.
ddd-laravel.martinjoo.dev
However, I personally like Actions better in larger applications.
If you’re interested in this topic subscribe to my DDD newsletter where I discuss these concepts. One e-mail every Wednesday until I finish the course I’m working on.
ddd-laravel.martinjoo.dev
Loading suggestions...