areia-lab/laravel-maintainer
Composer 安装命令:
composer require areia-lab/laravel-maintainer
包简介
Enhances Laravel maintenance mode with custom messages, countdowns, IP whitelisting, and an admin UI.
关键字:
README 文档
README
Extend Laravel's maintenance mode with a custom message, countdown timer, whitelist, and multi-server storage (file, redis, s3). Includes a modern admin UI built with TailwindCSS.
Installation
composer require areia-lab/laravel-maintainer
Publish configuration and views:
php artisan vendor:publish --tag=maintainer-config php artisan vendor:publish --tag=maintainer-views
Configuration
Edit config/maintenance.php to configure:
- driver — storage driver (
file,redis,s3) - file_path — path for
filedriver (default:storage/framework/maintenance.json) - redis_key — key for
redisdriver - s3_disk / s3_key — disk and key for
s3driver - message — default maintenance message
- whitelist_ips / whitelist_users — users or IPs allowed to bypass maintenance
- admin_path / admin_middleware — admin panel URL and middleware protection
- preview_path — optional preview route
Example .env:
MAINTENANCE_DRIVER=file MAINTENANCE_FILE_PATH=framework/maintenance.json MAINTENANCE_MESSAGE="We’ll be back soon after scheduled maintenance." MAINTENANCE_WHITELIST_USERS=1,2 MAINTENANCE_WHITELIST_IPS=127.0.0.1,192.168.1.10 MAINTENANCE_PREVIEW_PATH=maintenance/preview MAINTENANCE_ADMIN_PATH=maintenance/admin MAINTENANCE_ADMIN_MIDDLEWARE=web,auth MAINTENANCE_LOAD_ROUTES_IN_PRODUCTION=true
Supported Drivers
- file — stores maintenance state locally (default)
- redis — shared across multiple servers
- s3 — centralized state in S3
For multi-server deployments, prefer
redisors3.
Commands
Enable custom maintenance:
php artisan maintenance:enable php artisan maintenance:enable --message="Upgrading" --ends-at="2025-09-12 03:00" --whitelist-ips="127.0.0.1" --whitelist-users="1,admin@example.com" php artisan maintenance:enable --force
Disable maintenance:
php artisan maintenance:disable php artisan maintenance:disable --force
Admin UI
Visit the admin panel at:
/maintenance/admin
- Protect with
authmiddleware in production. - Features:
- Enable/disable maintenance mode
- Set custom message
- Set countdown (
ends_at) - Manage whitelisted users/IPs
- Real-time countdown display
Middleware Usage
Route::get('/', function () { return view('welcome'); })->middleware(['maintenance.check']); # Or as a group Route::middleware(['maintenance.check'])->group(function () { Route::get('/', function () { return view('welcome'); }); });
Preview Maintenance Page
Visit /maintenance/preview to preview the maintenance page without enabling it. Shows message, countdown timer, and optional whitelist info.
Notes
- Multi-server deployments: use
redisors3. - Security: always protect the admin panel routes with authentication.
- Customization: override views in
resources/areia/maintenance. - Preview in production: disable preview route if needed using
load_routes_in_productionin config.
License
MIT
areia-lab/laravel-maintainer 适用场景与选型建议
areia-lab/laravel-maintainer 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「maintenance」 「laravel」 「laravel-package」 「downtime」 「maintenance-mode」 「areialab」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 areia-lab/laravel-maintainer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 areia-lab/laravel-maintainer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 areia-lab/laravel-maintainer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
An enhanced drop-in replacement for Laravel's maintenance mode
Maintenance page plugin
Neos Content Repository Helper to rebirth orphaned nodes
Maintenance page, pretty and simple.
A Laravel package for converting English numbers into Bangla digits, Bangla words, Bangla month names, and Bangla money format with an easy-to-use API.
Laravel table comments loader (part of Diplodocker project)
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-14