stoffelio/statamic-turnstile 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

stoffelio/statamic-turnstile

最新稳定版本:v1.2.2

Composer 安装命令:

composer require stoffelio/statamic-turnstile

包简介

Add Cloudflare Turnstile verification to your Statamic forms

README 文档

README

Add Cloudflare Turnstile verification to your Statamic forms

Features

This addon lets you secure your Statamic forms with Cloudflare Turnstile, an alternative to services like Google reCaptcha.

Simply add the script to your site via our custom tag and then add a Turnstile field to any form you want to protect. Everything else is done for you.

You can also protect user registration forms by setting the TURNSTILE_PROTECT_REGISTRATION environment variable to true. If you're using this feature make sure to add {{ turnstile:field }} into the registration form page.

How to Install

Before setting up this addon you need to register with Cloudflare Turnstile and add your site. You will receive two keys that need to be added to your project's .env file.

TURNSTILE_SITE_KEY=0x4AAAAAAAAlfghdghfh387
TURNSTILE_SECRET_KEY=0x4AAAAAAAAlJftzhtjtrrjtznU-eVC4iU

Next install the addon via the control panel or simply run composer require stoffelio/statamic-turnstile.

To load the javascript needed to display the Turnstile widget on the front end, add the {{ turnstile:script }} tag to your site's head.

Lastly edit the blueprint for any form you want to secure and add a field of the Turnstile fieldtype.

Turnstile Field Output

This addon assumes that you use Statamic's {{ field }} tag to automatically pull in the view associated with each form field.

If you want to change the output, you can publish the view to the views/vendor folder using the php artisan vendor:publish --tag=turnstile-view command.

If you're creating your own form output and not using the field views, you can use the {{ turnstile:field }} tag to output your field manually.

Translate validation error message

If you want to change the translation of the validation error message you can publish the default language file using the php artisan vendor:publish --tag=turnstile-lang command.

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 2
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2022-09-29