Download the PHP package dengyihao/lumen-captcha without Composer
On this page you can find all versions of the php package dengyihao/lumen-captcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download dengyihao/lumen-captcha
More information about dengyihao/lumen-captcha
Files in dengyihao/lumen-captcha
Download dengyihao/lumen-captcha
More information about dengyihao/lumen-captcha
Files in dengyihao/lumen-captcha
Please rate this library. Is it a good library?
Informations about the package lumen-captcha
Captcha for Lumen
本项目修改自 Captcha for Laravel 5.
预览效果图
安装
- 项目必须启用缓存才能使用,因为验证码和验证码绑定的uuid都是保存在缓存的。
project's
composer.json
.
or
使用
在bootstrap/app.php
中注册Captcha Service Provider:
配置
在bootstrap/app.php
中可以配置各种自定义类型的验证码属性:
更多详细配置请查看https://github.com/mewebstudio/captcha
当然,也可以不配置,默认就是default的样式,验证码有效时间5分钟。
使用范例
因为lumen一般写的都是无状态的API,所以此处验证码的图片必须绑定一个uuid,获取图片验证码时,先获取验证码url地址和uuid,然后在验证时,提交验证码和uuid一并验证码。
生成验证码
获取验证码信息:
其中type
就是在配置文件中定义的验证码类型(如果你定义了的话),当然也可以不指定type
,则默认为default
,返回信息:
captchaUrl
为验证码图片地址,captchaUuid
为绑定验证码图片的uuid。
验证验证码
在请求中将验证码的值和uuid随着你的post请求一起发到服务端,在接收参数的地方做验证即可:
Links
All versions of lumen-captcha with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.4
ext-gd Version *
illuminate/config Version ~5.0
illuminate/filesystem Version ~5.0
illuminate/support Version ~5.0
illuminate/hashing Version ~5.0
intervention/image Version ~2.2
ext-gd Version *
illuminate/config Version ~5.0
illuminate/filesystem Version ~5.0
illuminate/support Version ~5.0
illuminate/hashing Version ~5.0
intervention/image Version ~2.2
The package dengyihao/lumen-captcha contains the following files
Loading the files please wait ....