Add to boot()
in AppServiceProvider.php
Queue::failing(function (JobFailed $event) {
// $event->connectionName
// $event->job
// $event->exception
$data['jobName'] = $event->job->getName();
$data['jsonEncodedData'] = json_encode($event->job->payload());
$data['exception'] = $event->exception;
// Add current timestring
$data['timeString'] = Carbon::now()->toDayDateTimeString();
Mail::send(['text' => 'emails.alert.queueFailing'], $data, function ($msg) {
$msg->to(config('mail.support'))
->from(config('mail.from'))
->subject('Queue Error Detected');
});
});