I
I
Ilich72020-05-20 19:11:07
Problem-Based Design
Ilich7, 2020-05-20 19:11:07

How to work with events in laravel DDD?

Hello.
I'm learning DDD on laravel and the question arose of how to handle events.
For example, I have an Order area in my domain. There can be several types of events (creation, status change, order change). On the status change event, you need to make an entry in the action log (this is processed inside the domain) and add the task of sending a letter to the queue (via laravel job).
The question is how to do it right? After all, in my mind, the domain does not know about the laravel job, etc. Where is it correct to store events (for example, they are generated in the handler, and then in the $handler->getEvents controller) and how to process them correctly? best practices?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question