hailkongsan / laravel-antibotlink
v0.1
2020-11-21 11:38 UTC
Requires
- illuminate/session: ^6.0 || ^7.0 || ^8.0
- intervention/image: ^2.5
- nesbot/carbon: ^2.0
Requires (Dev)
- orchestra/testbench: ^4.0 || ^5.0 || 6.0
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2024-09-21 20:54:26 UTC
README
安装
composer require hailkongsan/laravel-antibotlink
设置
此包支持 Laravel 5.5 及以上版本的自动发现功能,因此如果您使用的是 Laravel 5.5 及以上版本,请跳过这些 设置 指令。
在 app/config/app.php 中添加以下内容
1- 将 ServiceProvider 添加到 providers 数组中
Hailkongsan\AntiBotLink\AntiBotLinkServiceProvider::class,
2- 将类别名添加到 aliases 数组中
'AntiBotLink' => Hailkongsan\AntiBotLink\Facades\AntiBotLink::class
3- 发布供应商
php artisan vendor:publish --provider="Hailkongsan\AntiBotLink\AntiBotLinkServiceProvider" --tag="config"
用法
验证
$validate = Validator::make(Input::all(), [ 'antibotlink' => 'required|antibotlink' ]);
自定义验证消息
将以下值添加到 validation 语言文件中的 custom 数组中
'custom' => [ 'antibotlink' => [ 'required' => 'Please verify that you are not a robot.', 'antibotlink' => 'Invalid AntiBotLink verification!', ], ],
待办事项
- 清理和重构代码。
- 为渲染图像函数添加更多选项。
- 完成 README(用法)。