用于Laravel的Google reCaptcha Enterprise包
Laravel  /  管理员 发布于 1个月前   51
Google reCaptcha Enterprise for Laravel是一个软件包,它提供了简单的reCaptcha配置和一个方便的验证规则来验证你的用户令牌分数。
git:
https://github.com/oneduo/laravel-recaptcha-enterprise
下面是一个例子,
你可以使用这个包来验证用户的Recaptcha分数,使用提供的验证规则类。
use Illuminate\Foundation\Http\FormRequest;
use Oneduo\RecaptchaEnterprise\Rules\Recaptcha;
class TestRequest extends FormRequest
{
public function rules(): array
{
return [
'g-recaptcha-response' => [
'required',
new Recaptcha()
],
];
}
public function authorize(): bool
{
return true;
}
}
当验证一个reCaptcha标记时,你需要配置一个可接受的分数阈值,以考虑用户的有效性。
你可以使用这个包中提供的配置选项,根据reCaptcha数据定制你的应用程序的分数。
// config/recaptcha-enterprise.php
return [
'score_threshold' => 0.7,
// ...
];
你可以从GitHub上的
oneduo/laravel-recaptcha-enterprise
开始使用这个包,
并通过composer安装。
composer require oneduo/laravel-recaptcha-enterprise
博主 在
2023年国务院办公厅春节放假通知:1月21日起休7天中评论 @ xiaoB 你只管努力,剩下的叫给天意;天若有情天亦老,..xiaoB 在
2023年国务院办公厅春节放假通知:1月21日起休7天中评论 会不会春节放假后又阳一次?..BUG4 在
你翻墙过吗?国内使用vpn翻墙可能会被网警抓,你需了解的事中评论 不是吧?..博主 在
go语言+beego框架中获取get,post请求的所有参数中评论 @ t1 直接在router.go文件中配就ok..Jade 在
如何在MySQL查询中获得当月记录中评论 Dear zongscan.com team, We can skyroc..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号