Laravel queued job success notification

  laravel, laravel-8, laravel-excel, laravel-queue

I am curious how can I know when a queued job completed successfully to potentially notify the relevant user, if they choose to receive notifications.

Specifically I am working with a Laravel Excel export with the ShouldQueue trait. It includes a handy method to handle failed jobs, so I can notify the user on failure if needed (see https://docs.laravel-excel.com/3.1/exports/queued.html#handling-failures-in-queued-exports). I’m assuming there isn’t some success method that is either undocumented, or documented where I am not finding it, so….

Is there a way to use Laravel’s queuing system to detect when a job is finished? Even if I don’t truly know the status (success or fail) and I only know the job is done, I could check for the existence of the export file to confirm it was successful to trigger notification.

Thanks.

Source: Laravel

Leave a Reply