Package Data | |
---|---|
Maintainer Username: | erictt |
Maintainer Contact: | ericyang879@gmail.com (eric yang) |
Package Create Date: | 2017-05-15 |
Package Last Update: | 2017-05-19 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-19 03:09:29 |
Package Statistics | |
---|---|
Total Downloads: | 51 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Add the following line to the require
section of composer.json
:
{
"require": {
"erictt/recaptcha": "*"
}
}
app/config/app.php
.Erictt\Recaptcha\RecaptchaServiceProvider::class,
and the following to aliases
:
'Recaptcha' => Erictt\Recaptcha\Facades\Recaptcha::class,
Run php artisan vendor:publish --provider="Erictt\Recaptcha\RecaptchaServiceProvider"
.
In /config/recaptcha.php
, enter your reCAPTCHA sitekey and secret keys.
{!! Recaptcha->display(['dom', 'script']); !!}
{!! Recaptcha->display(['dom']); !!}
{!! Recaptcha->display(['script']); !!}
<div class="form-group{{ $errors->has('g-recaptcha-response') ? ' has-error' : '' }}">
<label for="g-recaptcha-response" class="col-md-4 control-label"></label>
<div class="col-md-6">
{!! Recaptcha::display(['dom']) !!}
@if ($errors->has('g-recaptcha-response'))
<span class="help-block">
<strong>{{ $errors->first('g-recaptcha-response') }}</strong>
</span>
@endif
</div>
</div>
Add 'g-recaptcha-response' => 'recaptcha'
to rules array.
PS: I don't think we need require
rule for this.
$validate = Validator::make(Input::all(), [
'g-recaptcha-response' => 'recaptcha'
]);