How to manage successful or failed task in Laravel
Categorized as Laravel
You can run specific code if your schedule succeeds or fails with this simple code:
$schedule->command('emails:send')
->daily()
->onSuccess(function () {
// The task succeeded
})
->onFailure(function () {
// The task failed
});