TuffRivers
6 months ago
402
0
Laravel

Events -> Listeners vs Handler

Posted 6 months ago by TuffRivers

I am created an event, UserCreated, which will fire a welcome email. Ive seen a few different tutorials, some say create and event and a listener, then the listener will trigger an email. But ont he laravel 7x documentation, it says to use event and a event handler?

Which is better for my use cause? I just want a simple way to que the job so my user can create an account and close our the connection while the send email can run in the background.

Previously ive done this with a dispatch and a job, just not sure what is the best for this use case or the differences between these three methods.

Thanks

Please sign in or create an account to participate in this conversation.