Skip to content
hellocron.com

Laravel Scheduler

This content is not available in your language yet.

The hellocron/laravel package instruments the Laravel Scheduler automatically. Install it, set one key, and every scheduled task reports run when it starts and complete or fail when it ends, with duration and exit code. When a task stops running altogether, the missing report raises the alert, which is the failure mode schedule:run logs can never show you.

Installation

Terminal window
composer require hellocron/laravel

Add your ingest key (panel, starts with ck_) to .env:

HELLOCRON_INGEST_KEY=ck_your_key

Done. The next schedule:run starts pinging, and monitors are created automatically on first ping, subject to your plan’s monitor limit.

What gets reported

  • run on start, complete on success, fail on a non-zero exit code or an exception (with the message), skip when a filter such as withoutOverlapping prevents the run
  • duration in seconds, exit code, hostname
  • a series id correlating each run’s start and end, so overlapping runs of the same task never pair up wrong (see Ping via GET)

Monitor names derive from the command: laravel-<app hash>-inspire. The hash comes from app.url, so several apps on one account stay apart. Override the prefix with HELLOCRON_PREFIX.

Monitor sync (optional)

Pings alone create monitors with default settings. To set expected intervals and grace periods computed from each task’s actual cron expression, add a Management API key (mk_, scopes read + write) and run:

Terminal window
php artisan hellocron:sync --dry-run
php artisan hellocron:sync

The command creates missing monitors, updates existing ones and reports monitors that no longer match any scheduled task. It never deletes anything. Run it after deployments that change the schedule.

Configuration

Terminal window
php artisan vendor:publish --tag=hellocron-config
KeyEnvDefault
enabledHELLOCRON_ENABLEDtrue
ingest_keyHELLOCRON_INGEST_KEYnone (package inert without it)
management_keyHELLOCRON_MANAGEMENT_KEYnone (only hellocron:sync needs it)
prefixHELLOCRON_PREFIXlaravel-<md5(app.url)[0:8]>-
tags-[] (sync always adds laravel and the hostname)

Safety

Monitoring must never take your app down. Pings use a 1 second connect and 2 second request timeout, and every failure is swallowed: if the monitoring endpoint is unreachable, your tasks run exactly as before. The Management API is only called from the hellocron:sync console command, never while the schedule executes.

Requirements

PHP 8.1+, Laravel 10, 11 or 12.