I've created a job to send an email at a specific time.
$remind_me_before = "10";
AppointmentReminderJob::dispatchIf(!empty($remind_me_before), $appointment, $user)->delay(Carbon::createFromFormat('Y-m-d H:i', $appointment->start_date)->subMinutes($remind_me_before));
Now what i want is to add the appointment id to the newly created job record, thus i need the job id so i can update it.
i've tried doing the solution of this page :
Laravel 5.8 How to get the job Id?
but no luck.
Edit :
i've found a working solution to do this in this
use Illuminate\Contracts\Bus\Dispatcher;
$job = ( new JOB_CLASS() )->onQueue('QUEUE_NAME')->delay('DELAY');
$id = app(Dispatcher::class)->dispatch($job);