Laravel Scheduler Monitoring

Get alerts when Laravel tasks miss their check-ins.

Keep Laravel running your tasks. Add a heartbeat after one command’s required work succeeds, then verify its next scheduled run and alert destination. No extra monitoring package required.

5 monitors free · No credit card · Verify a real scheduled run

A running scheduler is not proof that your task finished.

An hourly report can stop completing while your application still serves requests. A scheduler heartbeat only checks the scheduler invocation; a queue dispatch only shows that work was submitted.

Give important tasks separate monitors and send success after the work you depend on. PingCron watches for the next check-in and alerts after the configured schedule and grace period. It does not run, retry, or inspect your tasks.

Setup

Connect one Laravel command from schedule to completion.

Example: an existing reports:hourly command that completes its work synchronously. Adapt the paths, command, and schedule to your deployed application.

Create a monitor and copy its private success URL into the deployment secret PINGCRON_URL. Match the example’s 0 * * * * schedule and UTC timezone in PingCron, with grace for normal runtime and delay. Keep URLs out of source control and logs.

Real-world examples

1. Add inside the returned array in config/services.php

'pingcron' => [
    'url' => env('PINGCRON_URL'),
],

2. In routes/console.php — adapt the existing task, do not duplicate it

use Illuminate\Support\Facades\Schedule;

Schedule::command('reports:hourly')
    ->hourly()
    ->timezone('UTC');

3. In the existing command class — adapt handle(), preserve your workload

public function handle(): int
{
    // Replace with your required synchronous work.
    // It must throw on failure; otherwise check its result before reporting success.
    $this->performRequiredWork();

    try {
        $url = config('services.pingcron.url');
        if (!is_string($url) || trim($url) === '') {
            throw new \RuntimeException('Missing heartbeat configuration');
        }
        \Illuminate\Support\Facades\Http::connectTimeout(3)->timeout(10)
            ->get($url)->throw();
    } catch (\Throwable $error) {
        // Do not log the exception or private URL.
        \Illuminate\Support\Facades\Log::warning('Heartbeat delivery failed');
    }

    return self::SUCCESS;
}

4. Typical host cron entry — retain your existing scheduler if already configured

* * * * * cd /var/www/app && /usr/bin/php artisan schedule:run >> /dev/null 2>&1

Verify the deployed task, then rely on its alerts

Replace performRequiredWork() with your existing synchronous workload; it is an illustrative method, not a Laravel API. Keep workload exceptions outside the reporting catch. If your code returns a failure status, return a nonzero command exit code before the heartbeat. Do not replace real work with the placeholder or report success just after dispatching queued work.

For queued work, trace a Laravel scheduled job from dispatch through worker completion. The walkthrough covers queue selection, committed database work, and testing a missed-run alert with an isolated worker.

  1. Deploy the configuration: supply the private URL to the deployed application, rebuild its configuration cache through your normal release process, and restart long-running workers when required. Use config() in the workload; keep env() in configuration files.
  2. Check the schedule: run php artisan schedule:list from the deployed app and review the next run and timezone. Verify the host’s PHP path, working directory, account permissions, and outbound HTTPS. If a platform already invokes the scheduler, do not add a second trigger.
  3. Confirm completion: inspect the actual workload output and its first successful heartbeat. A manual command can test reporting; verify a later automatic scheduled run separately. For queued work, also verify the worker processed it.
  4. Verify an alert destination: save email, Slack, or Discord settings, send the labeled test, and confirm receipt. Set up and verify an alert destination. Test missed-run detection separately with an isolated short-interval monitor; do not interrupt production work.

If receipts are missing, check task execution first, then worker or command errors, then URL configuration and HTTP delivery. Review overlap locks, maintenance mode, and timezone changes when a due task is skipped. A receipt shows what the task reported; it does not validate the report’s contents.

Check a Laravel scheduled task — static configuration checks do not execute PHP or verify deployed workers and locks.

When more Laravel tasks justify Pro

Free includes 5 monitors, 7-day receipt history, and email, Slack, and Discord alerts. One owner monitoring six or more independent tasks can choose Pro at $9.99/month for up to 50 monitors. Pro also includes 30-day receipt history and custom outbound webhooks.

Stay on Free if it meets your needs. Shared account access starts on Team; Pro is for one account owner.

Choose Pro — $9.99/month

Create your account, then continue to checkout for the paid subscription.

References: Laravel scheduling and task hooks · Configuration caching · HTTP timeouts.

FAQ

Only for the scheduler invocation. It cannot prove every due command succeeded or that queued or background work finished. Use a separate monitor for each independently scheduled result you need to track.
For scheduled Artisan or system commands, thenPing() runs after execution regardless of the exit code. pingOnSuccess() runs only on exit code zero; pingOnFailure() runs on a nonzero exit code. Neither validates output or queued-worker completion. The handler example above explicitly limits request time and separates heartbeat delivery errors from workload errors.
Inside the worker after all required processing succeeds. Schedule::job() can dispatch queued work before it is processed, so its scheduling hooks do not prove worker completion. For a batch, report only after the required jobs finish; use separate monitors for independent tasks.
A workload exception stops the example before it sends success. A missing URL or failed HTTP request logs a generic warning without changing successful work into a failure. Inspect both application logs and PingCron receipts. A missing check-in triggers detection after the monitor’s schedule and grace, subject to processing and alert delivery delays.
Yes. Keep the schedule where your application already defines it, using its $schedule instance if appropriate. Adapt the existing task instead of adding a second declaration in routes/console.php. Verify against the documentation for your installed Laravel version.

Related monitoring guides

Verify your next Laravel task before adding more.

Start with one important command, its first successful heartbeat, and a confirmed alert destination. Upgrade when your monitoring needs grow.

Monitor one Laravel task free

5 monitors free · No credit card · Verify a real scheduled run