承接 jorisnoo/statamic-password-protect 相关项目开发

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

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

jorisnoo/statamic-password-protect

最新稳定版本:0.1.0

Composer 安装命令:

composer require jorisnoo/statamic-password-protect

包简介

Site-wide password protection for anonymous visitors

README 文档

README

Site-wide password protection for Statamic 6. Anonymous visitors must enter a password to view the site. Logged-in CP users always bypass the wall.

Settings are managed through the addon settings page in the Statamic control panel.

Requirements

  • PHP 8.3+
  • Statamic 6
  • Laravel 12

Installation

composer require jorisnoo/statamic-password-protect

Configuration

  1. Go to CP > Addons > Password Protect > Settings
  2. Toggle Enabled on
  3. Set a Password
  4. Optionally set a Title for the password page (defaults to your site name)
  5. Save

That's it. Anonymous visitors will now see a password prompt. Authenticated CP users are never affected.

How It Works

A middleware on the web group intercepts every frontend request. It checks (in order):

  1. Is password protection enabled with a password set? If not, pass through.
  2. Is this a CP route? Pass through.
  3. Is this the password form itself? Pass through.
  4. Is the visitor logged into Statamic? Pass through.
  5. Does the session have a valid authorization flag? Pass through.
  6. Otherwise, redirect to the password form.

After entering the correct password, visitors are redirected back to the page they originally requested. The session flag persists for the duration of the browser session.

Static Caching

When password protection is enabled, the addon automatically disables Statamic's static caching strategy. This ensures every request goes through the middleware and anonymous visitors cannot access cached pages.

When you disable password protection, static caching resumes normally.

SSG (Static Site Generator): This addon is not compatible with statamic/ssg. If you're generating a fully static site, password protection must be handled at the web server level (e.g., HTTP Basic Auth via nginx/Apache).

Testing

composer test

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固