Source: www.paulund.co.uk

Send An Alert When Laravel Jobs Fail
Laravel Jobs allow you to queue up processes to be done at a later date, this is normally reserved for longer running tasks or tasks that need to communicate with a third party. It's also a process that can run in the background and doesn't affect the user experience of the users of your app.

In this tutorial we're going to investigate how we can send a slack notification when a job fails in the queue.

https://www.paulund.co.uk/alert-laravel-failed-jobs#dealing-with-failed-jobsThere are two different ways of handling failed jobs you can either handle them singularly or you can handle it globally.

From this failed event we're going to use the Laravel Notifications class to send the alert to the slack channel.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners