Package Data | |
---|---|
Maintainer Username: | SamyOteroGlez |
Maintainer Contact: | otero.glez.samy@gmail.com (Samy Otero Glez) |
Package Create Date: | 2017-05-03 |
Package Last Update: | 2017-05-14 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-01-23 15:01:26 |
Package Statistics | |
---|---|
Total Downloads: | 24 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 2 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Google Recaptcha - Laravel integration
You can install directly using composer composer require coderscoop/laravel-recaptcha
Or include the package to your composer.json
"require": {
"coderscoop/laravel-recaptcha": "*"
}
Or download it directly from the github repository
And run composer install
or composer update
"require": {
"coderscoop/laravel-recaptcha": "*"
},
"repositories": [
{
"type": "git",
"url": "git@github.com:Coder-Scoop-Inc/laravel-recaptcha.git"
}
]
composer install
or composer update
Add Coderscoop\LaravelReCaptcha\ReCaptchaServiceProvider::class
, to the providers array in config\app.php.
Add 'ReCaptcha' => Coderscoop\LaravelReCaptcha\Facade\ReCaptchaFacade::class
, to the aliases array in config\app.php.
Add RECAPTCHA_PUBLIC_KEY
and RECAPTCHA_PRIVATE_KEY
to your .env file with the public and private keys.
Add the recaptcha field to your form {!! ReCaptcha::render() !!}
Optionally you can pass the recaptcha attributes as an array
{!!
ReCaptcha::render([
'theme' => 'light',
'includeScript' => true,
'responsive' => true
])
!!}
theme
: The google recaptcha themeincludeScript
: If includes or no the google recaptcha scriptresponsive
: Makes the field responsive or noOr you can interact directly with the class api in your controller by adding use ReCaptcha;
.
Add the recaptcha validation rule 'g-recaptcha-response' => 'required|recaptcha'
Enjoy it!
php artisan vendor:publish --tag=config
and you
will have access to the recaptcha config file in app/config/recaptcha.php