Skip to main content

Comments & Discussion

DS
Dmytro Sakharuk ✓ Link copied!

I can't understand what this is for?

switch ($this->notification->notification_class) {
case BookingReminder1H::class:
$this->notification->user->notify(new BookingReminder1H($this->notification->notifiable));
break;
case BookingReminder2H::class:
$this->notification->user->notify(new BookingReminder2H($this->notification->notifiable));
break;
case BookingReminder5MIN::class:
$this->notification->user->notify(new BookingReminder5MIN($this->notification->notifiable));
break;
case BookingStartedNotification::class:
$this->notification->user->notify(new BookingStartedNotification($this->notification->notifiable));
break;
}
M
Modestas ✓ Link copied!

this allows us to switch notification class based on what we saved in database. this allows us to quickly add/remove/replace notification classes

DS
Dmytro Sakharuk ✓ Link copied!

Your reminder classes should simply implement the BookingReminderInterface.

M
Modestas ✓ Link copied!

This was not the goal of this lesson :)

We don't want to add complications around things, when it is not the focus of a lesson

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.