One URL per job
A cron job sends a GET or POST request to a ping URL. Success, error, started, and unknown are separate states.
This package watches cron jobs that run outside your laravel application. The job calls one URL when it finishes. A scheduled command checks whether the next ping arrived and marks the monitor as down when it did not.
The overview explains the ping and health check flow. The usage guide lists every endpoint and status.
composer require jk-oster/laravel-cron-monitorPublish the config file and the migration, then migrate:
php artisan vendor:publish --tag=config
php artisan vendor:publish --tag=migrations
php artisan migrateThe package migration is a .php.stub file, so it has to be published before it can run.
The published file is config/cron-monitor.php. It sets the API prefix, the notification channels, and the model. Set notifications.mail.to and the Slack webhook before you enable those channels.
'api' => [
'enabled' => true,
'prefix' => 'cron-monitor',
'middleware' => [],
],The configuration reference lists every key.
Create a monitor:
php artisan cron-monitor:create "Nightly invoice export" \
--frequency=1440 \
--grace=10 \
--timezone="Europe/Vienna"The command prints the hash and the ping URL.
Ping it when the job succeeds:
curl -fsS "https://example.com/cron-monitor/ping/6f1c2f7a-0000-0000-0000-000000000000"Schedule the health check:
use Illuminate\Support\Facades\Schedule;
Schedule::command('cron-monitor:process-checks')->everyMinute();The scheduler has to run for the check to happen. Add it to routes/console.php.