erfanwmb/captcha
Composer 安装命令:
composer require erfanwmb/captcha
包简介
This package is for captcha
README 文档
README
Installation
Require this package with composer. It is recommended to only require the package for development.
composer require erfanwmb/captcha
You can change SECURITY_CAPTCHA in .env to gd or recaptcha or hcaptcha
Copy the package config to your local config with the publish command:
php artisan vendor:publish --provider="erfanwmb\captcha\CaptchaServiceProvider"
If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php
erfanwmb\captcha\CaptchaServiceProvider::class,
If you want to use the facade to log messages, add this to your facades in app.php:
'captcha' => erfanwmb\captcha\CaptchaFacade::class
Usage
-
set your recaptcha(google)
SECURITY_RECAPTCHA_SITE_KEYandSECURITY_RECAPTCHA_SECRET_KEYfor user recaptcha in config.env -
set your hcaptcha
SECURITY_RECAPTCHA_SITE_KEYandSECURITY_RECAPTCHA_SECRET_KEYfor user hcaptcha in config.env -
add flowing code to view to show captcha
@include('captcha.index')
example
@include('captcha.index',['theme_captcha'=>'light','exclusive_captcha'=>'gd'])
you can use exclusive_captcha for customize captcha in views
you can use theme_captcha for customize theme captcha in views
- use this to your request or validation
'g-recaptcha-response'=> [CaptchaFacade::validate($this->exclusive_captcha ?? null)]
warning
you don't need to add required for validation g-recaptcha-response
Update
- for update, you can use following command for just update views
php artisan vendor:publish --provider="erfanwmb\captcha\CaptchaServiceProvider" --tag="view"
-and if you want to update captcha config you can use following command
warning
this command rewrite all captcha config so recaptcha and hcaptcha (site_key & secret_key) delete
php artisan vendor:publish --provider="erfanwmb\captcha\CaptchaServiceProvider" --tag="config"
if you want to disable captcha temporally use following command
SECURITY_CAPTCHA=null
erfanwmb/captcha 适用场景与选型建议
erfanwmb/captcha 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 62 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 12 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「recaptcha」 「captcha」 「gd」 「laravel」 「hcaptcha」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 erfanwmb/captcha 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 erfanwmb/captcha 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 erfanwmb/captcha 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Client library for reCAPTCHA with proxy support, a free service that protects websites from spam and abuse.
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
A simple and easy to use Google ReCaptcha v3 package for Laravel
Two Captcha
Laravel 5 Securimage helper
CakePHP Captcha Plugin, Image, Math and Google Recaptcha Support
统计信息
- 总下载量: 62
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-23