syriable/maintenance-guard
Maintenance Guard adds a flexible maintenance-mode layer to Laravel apps, letting you gate requests behind custom checks, whitelist routes or IPs, and return friendly responses while work is in progress. Easy to configure and toggle.
Architecture fit. maintenance-guard is a Laravel package that targets the framework's native maintenance mode (php artisan down). Conceptually it slots into the HTTP kernel's middleware stack, which is the conventional and lowest-friction integration point for this class of functionality. It does not require replacing Laravel's CheckForMaintenanceMode behavior, so it should remain additive rather than invasive. Fit is good for teams already standardizing on Laravel's built-in maintenance semantics; it is a poor fit for teams running custom or non-Laravel edge-level maintenance handling (CDN, load balancer, ingress).
Integration feasibility. Composer-installable, service-provider-based, publishable config is the expected shape and is supported by the PR titles (package scaffolding + CI). Feasibility is high for a greenfield or mid-flight Laravel app: install, publish config, register middleware, define bypass rules. The unknown is the bypass mechanism itself — whether it is a signed token/URL, an IP/CIDR allowlist, a header, or a session/role check. That determines whether the integration is a 30-minute config change or requires touching auth and routing.
Technical risk. Several risks are material at this stage:
@alkhatibsy is the sole author across both PRs. No organizational backing is evident.X-Forwarded-For trust, proxy behavior).config:cache and down file lifecycle frequently break naive maintenance implementations. Unknown whether this package handles it.Key questions.
hash_equals (timing-safe)?Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode? What breaks if Laravel changes that middleware?config:cache, route caching, and multi-server deployments (shared secret distribution)?Stack fit. Best fit is a standard Laravel application (10.x/11.x presumed, unconfirmed) on a conventional PHP-FPM or Octane deployment, where developers want stakeholders, QA, or internal users to reach a "down" environment for verification. It is redundant for teams that already solve this at the edge (CDN maintenance page, ingress rules), and risky for anything where the bypass secret is the primary access control to sensitive data.
Migration path. Because there is no prior assessment and no incumbent version, there is no migration — this is a greenfield adoption decision. The pragmatic path is: pilot in a non-production environment, then a single low-risk production service, with a documented rollback (remove middleware registration, composer remove). Nothing about this package appears to require data migration or schema changes, so rollback cost is low. That asymmetry is the main argument for a trial.
Compatibility. Unverified. Two things must be confirmed before scheduling work: (a) the Laravel/PHP support range in composer.json, and (b) whether the middleware is registered globally or per-route-group. Global registration changes the blast radius and therefore the sequencing. Also confirm behavior under Octane, where long-lived workers can cache maintenance state if the package stores it in a static or in-memory property.
Sequencing. Recommended order:
Do not bundle this into a release that also carries unrelated risk; the failure mode is user-facing access denial, which makes for confusing incident triage.
Maintenance. Low ongoing cost if the package is thin, but ongoing cost is not the concern — durability is. A single-maintainer package with one release has a real probability of going stale against future Laravel major versions. Budget for the possibility of vendoring or forking the middleware (likely a few hundred lines) if it becomes load-bearing. That is a cheap contingency, but it should be an explicit decision rather than a surprise.
Support. No vendor support; community-only via GitHub issues. Internal ownership must be assigned before adoption — name a team and an individual who will own upgrades, secret rotation, and incident response for the bypass path. Without a named owner, this becomes orphaned infrastructure that nobody understands during an outage.
Scaling. Functionally, this scales fine: middleware is stateless per-request, so horizontal scale is not a concern. The scaling issue is operational — the bypass secret must be distributed consistently across every instance. That means it must come from config sourced from environment/secret management, not from a published config file committed to the repo. Multi-region or blue-green deployments make this sharper: a stale secret on one instance during a maintenance window is a silent partial outage for stakeholders.
Failure modes. Enumerate these explicitly during the pilot:
artisan up, so tolerable but disruptive.Each needs a documented detection signal. At minimum, log every bypass use with the requesting identity so an unexpected grant is auditable.
Ramp-up. Very low for an engineer familiar with Laravel middleware — an afternoon including source review. The larger ramp-up is organizational: agreeing what the bypass policy should be (who gets access, how it is granted, how it expires, who audits it). That policy conversation is the real work and should precede the install, not follow it. Given a 1.0.0 release with a single contributor and no production track record, the recommendation is adopt behind a pilot with a named owner, contingent on confirming fail-closed behavior and a tested version matrix — not a fleet-wide rollout on the strength of a first release.
How can I help you explore Laravel packages today?