granitibrahimi / google-recaptcha-laravel
Google reCAPTCHA For Laravel.
Installs: 106
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Open Issues: 0
pkg:composer/granitibrahimi/google-recaptcha-laravel
Requires
- php: >=5.4.0
- illuminate/support: 5.1.*
This package is not auto-updated.
Last update: 2015-11-29 01:42:49 UTC
README
Google reCaptcha for Laravel5
Installation
Add the following line to the require section of composer.json:
{
"require": {
"granitibrahimi/google-recaptcha-laravel": "1.1.*@dev"
}
}
Laravel 5 Setup
*. In /config/app.php, add the following to providers:
Gibrahimi\ReCaptcha\ServiceProvider,
and the following to aliases:
'ReCaptcha' => 'Gibrahimi\ReCaptcha\Facade',
. add RECAPTCHA_SECRET_KEY and RECAPTCHA_SITE_KEY in *.env** file:
RECAPTCHA_SECRET_KEY=[secret-key]
RECAPTCHA_SITE_KEY=[site-key]
OR
*. Run php artisan vendor:publish.
In /config/recaptcha.php, enter your reCAPTCHA public and private keys
return [
'site_key' => 'site-key'
'secret_key' => 'secret-key'
];
Usage
Display reCAPTCHA{!! ReCaptcha::display(); !!}
{!! $errors->first('g-recaptcha-response', '<span class="error">:message</span>') !!}
Validation
Add 'g-recaptcha-response' => 'required|recaptcha' to rules array.