Skip to content
AXVI BUILD · WRITE · SHIP
Packages

Laravel Maintenance

Maintenance mode for Laravel Rust applications: state in the database for every server, team access by IP, token or secret URL, and a 503 page with a countdown.

Laravel Maintenance

The state lives in your database, so every server behind a load balancer goes down and comes back together. While the application is down, your team still gets in: by IP address, by a token in a cookie or a header, or through a secret URL. Everyone else sees a 503 page with a countdown, or a JSON error if they asked for JSON.

Features

  • IP whitelist, each address with an optional label and expiry
  • Named bypass tokens: a cookie for browsers, a header for APIs, a secret URL that sets the cookie
  • Hashed tokens: stored as SHA-256, and the cookie holds neither the token nor its hash in the clear
  • Scheduled end: maintenance mode turns itself off at --ends-at
  • 503 page with a countdown, which you can replace, and JSON for clients that want JSON
  • Excluded paths such as health checks and webhooks
  • Cached state, so a request doesn't query the database
  • Fails open: if the tables are missing, requests go through and a warning is logged
  • Tested on SQLite, PostgreSQL and MySQL

Installation

[dependencies]
laravel-maintenance = "0.3"

Register laravel_maintenance::MaintenanceServiceProvider in src/app.rs and run laravel migrate.

Usage

laravel maintenance:down \
    --message="We'll be back in 30 minutes" \
    --allow=192.168.1.1 \
    --secret=let-me-in \
    --ends-at="2026-12-24 03:00:00"

Bypass tokens, excluded paths, configuration and events are in the README on GitHub. For Laravel PHP, see Laravel Maintenance.

Esc