Laravel maintenance mode and health checks

Carlos Mendez Jan 2026
3 tabs
{{-- resources/views/errors/503.blade.php --}}
<!DOCTYPE html>
<html>
<head>
    <title>Maintenance Mode</title>
    <style>
        body {
            font-family: sans-serif;
            text-align: center;
            padding: 50px;
        }
    </style>
</head>
<body>
    <h1>We'll be right back!</h1>
    <p>
        @if(isset($exception) && $exception->getMessage())
            {{ $exception->getMessage() }}
        @else
            Our site is currently undergoing scheduled maintenance.
        @endif
    </p>
    <p>Please check back soon.</p>
</body>
</html>
3 files · blade, bash, php Explain with highlit

Maintenance mode gracefully takes applications offline for updates without showing errors. The php artisan down command activates maintenance mode, showing a default or custom view. The --secret option creates bypass tokens for testing. The --retry header tells clients when to retry. Health check endpoints monitor application status for load balancers. I implement checks for database, cache, queue workers, and external dependencies. The up command restores normal operation. Maintenance mode uses a file lock preventing race conditions. For zero-downtime deployments, I use rolling restarts with health checks. This ensures reliable updates without user-facing errors.