Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mathiasgrimm's avatar

Queue::failing Laravel 5

Hi guys. I would like to know where is the best place to put Queue::failing on Laravel 5

0 likes
9 replies
graham's avatar

I have mine in

App\Providers\EventServiceProvider.php

    public function boot(DispatcherContract $events)
    {
        parent::boot($events);
        Queue::failing(function($connection, $job, $data)
        {
            Log::info('WARNING EVENT FAILED');
        });
    }
1 like
tuitionio's avatar

I am using Laravel 5. 1 and I can never get this event to occur, either via Queue::failing inside the boot() method of AppServiceProvider.php, or EventServiceProvider.php, or even by calling the failed() method inside the actual job classes. This just doesn't work at all. Yet the job does get placed into the failed_jobs table so I know that part works. Has anyone else seen this behavior in Laravel 5.1?

2 likes
nrmorgan's avatar

@tuitionio Yes experiencing the same problem in Laravel 5.0. The failed method doesn't get fired.

stuartowen89's avatar

please can anyone advise on this, having the issue now, failed() job doesn't seem to fire at all.

1 like
dillscher's avatar

Hi there,

I did have some issues with failed jobs, so I would like to notify myself, if these happen once again. But wonder how to do that.

Here is my setup:

I simply have some event listeners implementing ShouldQueue, nothing else, and works fine. But where should I hook in in case a job fails?

Struggling at the same point.

Cheers

Christian

Please or to participate in this conversation.