dizatech/cutlet-recaptcha
最新稳定版本:v1.0.4
Composer 安装命令:
composer require dizatech/cutlet-recaptcha
包简介
A package to use google recaptcha v2 with component and rule in laravel apps.
关键字:
README 文档
README
Installation
composer require va/cutlet-recaptcha
Publish Config file
php artisan vendor:publish --tag=cutlet-recaptcha
Usage
Set the values for google api in .env file:
GOOGLE_RECAPTCHA_SITE_KEY=
GOOGLE_RECAPTCHA_SECRET_KEY=
You can add this tag in blade files:
<x-cutlet-recaptcha :has-error="$errors->has('g-recaptcha-response')"></x-cutlet-recaptcha>
and in the validation parts:
protected function validateLogin(Request $request)
{
$request->validate([
$this->username() => ['required', 'string'],
'password' => ['required', 'string'],
'g-recaptcha-response' => ['required', 'cutlet_recaptcha']
]);
}
and you can customize the language and validation message in config file;
return [
'language' => 'fa',
'site_key' => env('GOOGLE_RECAPTCAH_SITE_KEY'),
'secret_key' => env('GOOGLE_RECAPTCAH_SECRET_KEY'),
'message' => 'شما به عنوان ربات تشخیص داده شدهاید'
];
Requirements:
- PHP v7.0 or above
- Laravel v7.0 or above
统计信息
- 总下载量: 63
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-13