gourabsutradhar/secureimage
最新稳定版本:v1.0.3
Composer 安装命令:
composer require gourabsutradhar/secureimage
包简介
A simple captcha package for laravel
README 文档
README
A captcha for laravel framework.
Setup
Require this package with composer:
composer require gourabsutradhar/secureimage
To use your own settings, publish config using the command
php artisan vendor:publish
Add Gourabsutradhar\SecureImage\SecireImageServiceProvoder to config\app.php file.
Web route
Show a captcha
use the secureimage_base64() to show an image.it returns base 64 string of image.
<form method="post" action="{{route('verify.web')}}">
<image src="{{secureimage_base64()}}">
@csrf
<br>
<input type="text" name="code">
<br>
<input type="submit" value="verify">
</form>
Verify it
here is example code to verify a image in web route
$validator=Validator::make(request()->all(),['code'=>'secureimage_web']);
API
Show a captcha
Api route [path : api/secureimage, name : secureimage.api] returns json data with 2 key named 'image' and 'key'. the 'image' key is base64 string representation of the image and 'key' is key of image. Save the 'key' value to verify it. send user typed code and the 'key' value to your server. here is example verification code.
$validator=Validator::make(request()->all(),['code'=>'secureimage_api:'.$request->key]);
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-15