
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.
A typical Laravel production deployment includes:
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.
Laravel doesn't include a built-in health check package, but there are excellent community options.
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.
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.
Configure an external uptime monitor pointing at your health endpoint:
https://yourdomain.com/health"status":"ok" in responseThis 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.
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.
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
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.
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:
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.
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.
/health endpoint checking database + cache + RedisThis 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.
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 moreCursor 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 moreClaude 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 moreLooking to monitor your website and domains? Join our platform and start today.