Monitor Laravel Scheduled Commands with CronRabbit

Laravel

The Problem

Laravel's task scheduler runs all commands via a single cron entry. If one command fails, the others still run, but you get no notification about the failure.

The Solution

Laravel has built-in support for monitoring pings. Use pingBefore(), thenPing(), and pingOnFailure() with CronRabbit URLs.

Native Laravel Support

Laravel's scheduler natively supports pingBefore(), thenPing(), and pingOnFailure() — perfect for CronRabbit integration with zero additional code.

Code Examples

Laravel Kernel.php with monitoring

PHP
// app/Console/Kernel.php
protected function schedule(Schedule $schedule): void
{
    $schedule->command('reports:generate')
        ->dailyAt('06:00')
        ->pingBefore('https://ping.cronrabbit.com/report-id/start')
        ->thenPing('https://ping.cronrabbit.com/report-id')
        ->pingOnFailure('https://ping.cronrabbit.com/report-id/fail');

    $schedule->command('cleanup:sessions')
        ->hourly()
        ->thenPing('https://ping.cronrabbit.com/cleanup-id')
        ->pingOnFailure('https://ping.cronrabbit.com/cleanup-id/fail');
}

Ready to Monitor Your Cron Jobs?

Create your free account and add your first monitor in under 5 minutes. No credit card required.