Skip to main content

Cleaning up Controllers: Events/Listeners

Premium
9 min read

Comments & Discussion

DS
Dmytro Sakharuk ✓ Link copied!

It's a bad practice to place reminder creation logic in the Booking model! In this context, why create new events, essentially duplicating eloquent.created: App\Models\Booking, etc.? Why not use an observer where you could actually add reminder creation logic createReminderNotifications?

M
Modestas ✓ Link copied!

Events can be used for much more triggers than a model. But it all depends on what you want/need :)