I was trying to record some data from other table when the jobs fails. It works great in failed jobs table but I cant get the Queue::failing(function($connection, $job, $data) to work every time the job failed. I did try to put it in global.php but no luck.
Another question is what does the $job return? An object or just the job id?
Work on global php. Its causing an error, just changed following:
Queue::failing(function($connection, $job, $data)
To:
Queue::failing(function($connection, $job)