I have a therapist system and each therapist add a session with its time when a client book a session
i run a queued job
to remind the client and doctor
- when the session starts
- before the session start with 3 hours
- before the session start with 1 hour
here is an example of my code
if($this->timeslot->last_charge_type == 'success'){
dispatch(new SessionReminderJob($this->timeslot, $patient, $doctor))
->delay($this->timeslot->start_time->subHour());
dispatch(new SessionReminderJob($this->timeslot, $patient, $doctor))
->delay($this->timeslot->start_time->subHours(3));
}
my problem is when a client wants to reschedule this session how to stop all of these jobs and run a new one with the new time.
I searched for some answers here but not efficient for my case like this
- question 1
- another one in laracasts