wtone/lumen-captcha
Composer 安装命令:
composer require wtone/lumen-captcha
包简介
Laravel 5 & 6 & lumen 6 Captcha Package
README 文档
README
A simple Lumen service provider for including the Captcha for Laravel.
for Lumen 6
Preview
Based on news/captcha
Installation
The Captcha Service Provider can be installed via Composer by requiring the
mews/captcha package and setting the minimum-stability to dev (required for Lumen 6) in your
project's composer.json.
{
"require": {
"wtone/lumen-captcha": "~2.0"
},
"minimum-stability": "dev"
}
or
Require this package with composer:
composer require wtone/lumen-captcha
Update your packages with composer update or install with composer install.
In Windows, you'll need to include the GD2 DLL php_gd2.dll in php.ini. And you also need include php_fileinfo.dll and php_mbstring.dll to fit the requirements of wtone/lumen-captcha's dependencies.
Usage
To use the Captcha Service Provider, you must register session provider and captcha provider when bootstrapping your application.
Configuration
create a new file config/captcha.php
return [ 'default' => [ 'length' => 5, 'width' => 120, 'height' => 36, 'quality' => 90, 'math' => true, //Enable Math Captcha ], // ... ];
create a new file config/session.php
return [ 'driver' => env('SESSION_DRIVER', 'file'),//默认使用file驱动,你可以在.env中配置 'lifetime' => 120,//缓存失效时间 'expire_on_close' => false, 'encrypt' => false, 'files' => storage_path('framework/session'),//file缓存保存路径 'connection' => null, 'table' => 'sessions', 'lottery' => [2, 100], 'cookie' => 'laravel_session', 'path' => '/', 'domain' => null, 'secure' => false, ];
in bootstrap/app.php.
// regiseter Provider $app->register(Illuminate\Session\SessionServiceProvider::class); $app->register(Wtone\Captcha\CaptchaServiceProvider::class); // load config $app->configure('session'); $app->configure('captcha'); // set alias $app->alias('session', 'Illuminate\Session\SessionManager'); $app->alias('Captcha', Wtone\Captcha\Facades\Captcha::class);
make sure create folder "storage/framework/session" and chmod it
Return Image
captcha();
or
Captcha::create();
Return URL
captcha_src();
or
Captcha::src('default');
Return HTML
captcha_img();
or
Captcha::img();
To use different configurations
captcha_img('flat'); Captcha::img('inverse');
etc.
^_^
wtone/lumen-captcha 适用场景与选型建议
wtone/lumen-captcha 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 698 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 03 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「captcha」 「laravel5 Security」 「laravel6 Captcha」 「laravel6 Security」 「Lumen6 laravel6 Captcha」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 wtone/lumen-captcha 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wtone/lumen-captcha 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 wtone/lumen-captcha 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
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.
Provide a way to secure accesses to all routes of an symfony application.
Laravel helpers for dev
Two Captcha
It's a barebone security class written on PHP
统计信息
- 总下载量: 698
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-03-19