承接 el-schneider/statamic-maintenance-mode 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

el-schneider/statamic-maintenance-mode

最新稳定版本:v0.2.0

Composer 安装命令:

composer require el-schneider/statamic-maintenance-mode

包简介

Set your statamic site into maintenance mode

README 文档

README

Auto Alt Text

Statamic Maintenance Mode

Manage maintenance mode through Statamic's control panel using Laravel's native maintenance system

Requirements

  • Statamic 5 or 6
  • PHP 8.3+

Features

  • Laravel Native: Uses Laravel's built-in artisan down/up commands, supporting all standard options like retry headers, refresh intervals, and secret bypass URLs
  • Flexible Display: Show any Statamic entry as your maintenance page, or use Laravel's default 503 error template
  • Bypass URLs: Generate shareable secret URLs that grant access during maintenance
  • Page Whitelisting: Keep specific entries accessible while the rest of the site is down
  • CP and CLI: Manage maintenance mode through the control panel or terminal interchangeably

Installation

composer require el-schneider/statamic-maintenance-mode

The addon automatically detects your Statamic version and uses the appropriate UI — an Inertia Vue component on v6, a Blade view on v5.

Usage

Navigate to Utilities > Maintenance in the control panel to configure and activate maintenance mode.

Control panel users with "access cp" permission can browse the frontend during maintenance.

Configuration

Publish the configuration file:

php artisan vendor:publish --tag=statamic-maintenance-mode-config

Refer to the published configuration file (config/statamic/maintenance-mode.php) for available options.

Customizing the Error Page

When no Statamic entry is selected, visitors see Laravel's default 503 error page.

To customize it, publish Laravel's error templates:

php artisan vendor:publish --tag=laravel-errors

Then edit resources/views/errors/503.blade.php.

Static Caching

When using Statamic's full measure static caching, your web server serves pre-rendered HTML files directly, bypassing PHP entirely. This means Laravel's maintenance mode check won't run for cached pages.

To ensure maintenance mode works correctly, modify your server config to skip static file serving when the down file exists. This forces requests through PHP where Laravel can handle maintenance mode properly.

Nginx:

set $try_static_files = "";

if (-f $document_root/../storage/framework/down) {
    set $try_static_files "skip";
}

if (-f "${document_root}/static${uri}_${query_string}.html") {
    set $try_static_files "${try_static_files}+exists";
}

if ($try_static_files = "+exists") {
    rewrite ^(.*)$ /static$1_$query_string.html last;
}

Apache (.htaccess):

RewriteCond %{DOCUMENT_ROOT}/../storage/framework/down !-f
RewriteCond %{DOCUMENT_ROOT}/static%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteRule .* static%{REQUEST_URI}_%{QUERY_STRING}.html [L,T=text/html]

Half measure static caching works without server configuration since requests still pass through PHP.

统计信息

  • 总下载量: 104
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固