Laravel application monitoring dashboard showing health check status and queue worker uptime
# web development

How to Monitor Laravel Applications for Uptime and Health

Laravel is one of the most popular PHP frameworks for building web applications, REST APIs, and SaaS platforms. A production Laravel application has several components that can fail independently — the web server, the queue worker, the scheduled tasks, the database, and the cache layer.

Effective Laravel application monitoring requires external uptime checks plus health endpoints that verify your full application stack is operational.

The Laravel Application Stack

A typical Laravel production deployment includes:

  • Web server (Nginx or Apache) serving the application
  • PHP-FPM processing PHP requests
  • MySQL/PostgreSQL for the primary database
  • Redis for caching and queue management
  • Laravel Horizon or queue workers for background job processing
  • Laravel Scheduler for cron-based tasks

Any of these components can fail independently. An external HTTP uptime check catches web server and PHP failures. For deeper stack monitoring, you need a health endpoint that actively checks database and cache connectivity.

Step 1: Add a Laravel Health Check Endpoint

Laravel doesn't include a built-in health check package, but there are excellent community options.

Using spatie/laravel-health

The spatie/laravel-health package provides comprehensive health checking:

composer require spatie/laravel-health
// App/Providers/AppServiceProvider.php
use Spatie\Health\Facades\Health;
use Spatie\Health\Checks\Checks\DatabaseCheck;
use Spatie\Health\Checks\Checks\RedisCheck;
use Spatie\Health\Checks\Checks\CacheCheck;

Health::checks([
    DatabaseCheck::new(),
    RedisCheck::new(),
    CacheCheck::new(),
]);

This exposes a /health endpoint that returns a JSON summary of all component statuses. Point your uptime monitor at this endpoint.

A Minimal Custom Health Route

If you prefer a simple approach:

// routes/web.php
Route::get('/health', function () {
    try {
        DB::connection()->getPdo();
        return response()->json(['status' => 'ok']);
    } catch (Exception $e) {
        return response()->json(['status' => 'error'], 503);
    }
});

This checks database connectivity and returns 503 on failure — which triggers your uptime monitor alert.

Step 2: External HTTP Monitoring

Configure an external uptime monitor pointing at your health endpoint:

  • URL: https://yourdomain.com/health
  • Interval: 1 minute
  • Expected status: 200
  • Content check: verify "status":"ok" in response

This check runs from outside your infrastructure, confirming your site is accessible from the internet — not just internally. It catches Nginx failures, PHP-FPM crashes, and networking issues that wouldn't show up in internal health checks.

Step 3: Monitor Laravel Queues with Heartbeats

Laravel queues are a common failure point. Queue workers run as separate processes and can die silently. A backed-up queue means emails aren't sent, notifications aren't delivered, and background processing stalls.

Use heartbeat monitoring with a scheduled health-ping job:

// App/Console/Kernel.php
protected function schedule(Schedule $schedule)
{
    $schedule->call(function () {
        Http::get(config('monitoring.heartbeat_url'));
    })->everyFiveMinutes();
}

If the scheduler stops running (because the cron job was misconfigured, a deploy broke the schedule, etc.), the heartbeat stops and you get an alert. See cron monitoring for full details.

Step 4: Monitor Laravel Horizon

If you're using Laravel Horizon to manage queues, Horizon itself needs monitoring. Horizon exposes a /horizon dashboard and a status API. You can monitor the Horizon dashboard URL directly, or better, add a custom check that verifies Horizon is in a running state:

// In your health check
use Laravel\Horizon\Contracts\MasterSupervisorRepository;

$status = app(MasterSupervisorRepository::class)->all();
// Return 503 if Horizon has no running supervisors

Step 5: SSL and Domain Monitoring

Add SSL certificate monitoring and domain expiry monitoring to your Laravel application's domain. These are independent of your application stack but equally important — an expired certificate or domain takes your app offline regardless of how well your PHP code runs.

Monitoring Laravel in Different Environments

Forge / Vapor

If you're deploying via Laravel Forge or Laravel Vapor, these platforms provide some infrastructure monitoring, but external uptime monitoring from Domain Monitor remains important because:

  • Platform monitoring doesn't catch application-level failures (database errors, PHP crashes)
  • External monitoring verifies accessibility from the user's perspective
  • Platform status pages don't send personalised alerts to your team

Docker

For Laravel in Docker, add health check configuration to your compose file:

healthcheck:
  test: ["CMD", "curl", "-f", "http://localhost/health"]
  interval: 30s
  timeout: 10s
  retries: 3

Pair this with external HTTP monitoring for complete coverage.

Handling False Alerts During Deployments

Laravel deployments often involve brief periods of unavailability — running migrations, clearing caches, restarting queue workers. Configure maintenance windows in your monitoring tool to suppress alerts during planned deployments.

Alternatively, use Laravel's maintenance mode (php artisan down) which returns a 503 — configure your monitor to treat 503 as "expected during maintenance" during your deployment window.

A Complete Laravel Monitoring Checklist

  • /health endpoint checking database + cache + Redis
  • HTTP uptime monitor on health endpoint (1 min interval)
  • HTTP uptime monitor on homepage or primary API route
  • Heartbeat monitor for Laravel Scheduler
  • Heartbeat monitor for queue workers / Horizon
  • SSL certificate monitoring (30-day advance alerts)
  • Domain expiry monitoring
  • Maintenance window configuration for deploys
  • Email + SMS + Slack alerts configured

This covers the complete Laravel stack — from external accessibility through to background processing and infrastructure-level risks.

Domain Monitor provides all of these monitoring types in a single platform, making Laravel application monitoring straightforward to set up and maintain.


Monitor your Laravel application uptime at Domain Monitor.

More posts

What Is Generative AI? How It Works and What It Creates

Generative AI creates new content — text, images, code, and more. This guide explains how it works, what tools are available, and where it's genuinely useful versus overhyped.

Read more
What Is Cursor AI? The AI Code Editor Explained

Cursor AI is an AI-powered code editor built on VS Code. Learn what it does, how it works, and whether it's the right tool for your development workflow.

Read more
What Is Claude Opus? Anthropic's Most Powerful Model Explained

Claude Opus is Anthropic's most capable AI model, built for complex reasoning and demanding tasks. Learn what it does, how it compares, and when to use it.

Read more

Subscribe to our PRO plan.

Looking to monitor your website and domains? Join our platform and start today.