Search by

curly-deni / laravel-maintenance

curly-deni

Maintenance windows and runtime availability for Laravel applications.

Package info

github.com/curly-deni/laravel-maintenance

pkg:composer/curly-deni/laravel-maintenance

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0 2026-09-30 11:07 UTC

This package is auto-updated.

Last update: 2026-09-30 11:08:18 UTC


README

curly-deni/laravel-maintenance provides scheduled maintenance windows, a file-backed runtime state, middleware for draining new work, and Artisan commands for operating maintenance windows.

Installation

composer require curly-deni/laravel-maintenance
php artisan vendor:publish --tag=laravel-maintenance-migrations
php artisan migrate

The migration creates operations__maintenance_windows and an internal lock table used to serialize window saves. The optional created_by column is an unsigned ID without a foreign key so the package does not depend on an application's user table.

Publish the configuration to customize the maintenance table name and runtime state locations. The table setting is used by both the Eloquent model and the migration stub; set it before running the migration and keep it (along with lock_table) unchanged for rollbacks.

php artisan vendor:publish --tag=laravel-maintenance-config

Usage

The package registers these commands:

php artisan maintenance:status
php artisan maintenance:status --json
php artisan maintenance:sync-state
php artisan maintenance:cancel {window}
php artisan maintenance:complete {window}

Apply the maintenance.new-work middleware alias to routes that should reject new operations while a window is draining. The package updates the runtime state file when maintenance:sync-state runs and broadcasts Aesis\Maintenance\Events\MaintenanceAvailabilityChanged when the public state changes.

The current runtime state can be read without querying the database:

use Aesis\Maintenance\Facades\Maintenance;

$phase = Maintenance::phase();
$state = Maintenance::payload();

Development

composer test
composer analyse
composer format

License

MIT. See LICENSE.md.