j25/google-captcha
最新稳定版本:2.0
Composer 安装命令:
composer require j25/google-captcha
包简介
Google captcha v3.0 for laravel
README 文档
README
Google captcha 3.0 for laravel 10,11
Installation
Require this package with composer:
composer require j25/google-captcha
Update your packages with composer update or install with composer install.
Usage
To use the Google Captcha Service Provider, you have to register the provider in your Laravel framework.
Find the providers key in config/app.php and register the Captcha Service Provider.
'providers' => [ // ... 'J25\GoogleCaptcha\Providers\GoogleCaptchaServiceProvider', ]
Configuration
You can use two captcha keys when you get them in your google account.
Add them in the .ENV file
RE_SITE_KEY ="XXXXXXXXXX" RE_SEC_KEY="XXXXXXXXXX"
Example
view files
//post.blade.php <form action="{{ route ('post')}}"> <x-google-captcha /> </form
controller files
use J25\GoogleCaptcha\GoogleCaptcha; Validator::make($input, [ 'recaptcha_response' => 'required|captcha' ])->validate(); or public function rules(): array { return [ 'name' => ['string'], 'text' => ['string'], 'recaptcha_response' => ['required', new GoogleCaptcha] ]; }
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-03