The shortest end-to-end story. Two terminals, one browser.
composer require daycry/maintenancemode
php spark mm:publishIn app/Config/Filters.php:
public array $aliases = [
'maintenance' => \Daycry\Maintenance\Filters\Maintenance::class,
];
public array $globals = [
'before' => ['maintenance'],
];php spark mm:down --message "Upgrading the database, back in 30 minutes" --duration 30Output:
**** Application is now in MAINTENANCE MODE ****
Cookie bypass: set cookie 'WAh0z8x3' with value '44746b03e6...e1'
π§ Application is in MAINTENANCE MODE
Storage method: Cache
π Current Bypass Status:
π IP Address bypass configured (current IP 0.0.0.0 not in allowed list)
πͺ Cookie bypass configured (cookie not set or invalid)
π¦ Access Status from CLI:
β
Access ALLOWED: CLI access (always allowed)
curl -i http://localhost:8080/
HTTP/1.1 503 Service Unavailable
Retry-After: 3600
Content-Type: text/html; charset=UTF-8
<!DOCTYPE html>
<title>Service Unavailable</title>
... message: "Upgrading the database, back in 30 minutes"Three options, pick whichever fits.
# Activate with your IP allow-listed:
php spark mm:up
php spark mm:down --message "..." --ip "203.0.113.5 10.0.0.0/8"php spark mm:up
php spark mm:down --message "..." --secret "supersecret"
# Then visit:
curl -i 'http://localhost:8080/?maintenance_secret=supersecret'
HTTP/1.1 200 OKphp spark mm:down --message "..."
# Output mentions: Cookie bypass: set cookie 'WAh0z8x3' with value '<HEX>'
curl -i -b "WAh0z8x3=<HEX>" http://localhost:8080/
HTTP/1.1 200 OKphp spark mm:statusThe Access Status from CLI block walks the bypass evaluation step by step
and tells you exactly why the current session is allowed or blocked.
php spark mm:up**** Application is now LIVE! ****
Users can now access the application normally.
The maintenance.deactivated event is emitted β wire a listener to clear
edge caches, ping a webhook, or whatever post-maintenance tasks you have.