wp-cli/maintenance-mode-command
Enables, disables, and checks WordPress maintenance mode from the command line using WP-CLI. Manage the .maintenance file with simple commands, optionally adding a custom message or retry interval, without touching the dashboard or filesystem manually.
Framing correction: despite the "Laravel/PHP package" label, this is a WP-CLI bundle command for WordPress — not a Laravel package. There is no service provider, facade, config file, or publishable asset. Its entire surface is three subcommands (activate, deactivate, status) executed by the wp binary. The integration boundary for a Laravel shop is therefore a shell invocation in a deploy pipeline, not a PHP API call.
.maintenance drop-in in the WordPress root and reads it back to report status. Execution is process-local CLI; there is no daemon, queue, or HTTP layer to hook into.wp package install (or rely on bundle inclusion) with a pinned version, then call wp maintenance-mode activate --path=... from an Artisan command, a Deployer/Envoyer step, or a GitHub Actions job over SSH. The contract is exit code plus STDOUT — nothing more.touch .maintenance, a plugin toggle) does this replace?Two-plane model. The Laravel plane installs nothing: it gets a thin wrapper — an Artisan command or deploy hook with a timeout, exit-code mapping, and structured logging. The WordPress plane gets WP-CLI with this package pinned in the CLI's composer.json (or a pinned wp-cli version if bundled).
rsync or wp db export. Never add it to the application's require block; it does not belong in vendor/ for runtime use.touch), standardize on one command wrapper, then deprecate the ad-hoc paths. Measure success as "zero hand-edited .maintenance files."wp is reachable and version-consistent on every target; (2) pilot on one low-traffic site with manual activate → status → deactivate; (3) build the wrapper with a guaranteed deactivate in a trap/finally and a hard maximum maintenance window; (4) wire into the deploy pipeline behind an approval gate; (5) feed status into monitoring; (6) roll out site-by-site behind a flag.WP_CLI_CS with PHPCS, PHPStan, Behat, and PHPUnit on every PR — a good signal for a small utility. Note the full composer test installs WordPress per scenario and takes tens of minutes; budget CI time only if we fork..maintenance semantics, and the wp-config/DB prerequisites. Ship a one-page runbook: activate, verify via status plus a curl for 503, deactivate, escalate.Recommendation: Adopt as a narrow, version-pinned operational utility if WordPress sits in the estate; do not model it as a Laravel dependency or a platform capability. The opportunity: 65 reads as headroom for a wrapper, a runbook, and a stuck-site watchdog — not as a reason to build anything on top of it.
How can I help you explore Laravel packages today?