2017 © Pedro Peláez
 

library recaptcha

reCAPTCHA Validator for Laravel 4

image

bodeezy/recaptcha

reCAPTCHA Validator for Laravel 4

  • Saturday, December 6, 2014
  • by bodeezy
  • Repository
  • 1 Watchers
  • 0 Stars
  • 159 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 148 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

Recaptcha

A reCAPTCHA Validator for Laravel 4., (*1)

Installation

Add the following line to the require section of composer.json:, (*2)

{
    "require": {
        "bodeezy/recaptcha": "dev-master"
    }
}

Laravel 4 Setup

  1. Add Greggilbert\Recaptcha\RecaptchaServiceProvider to the service provider list in app/config/app.php.
  2. Run php artisan config:publish greggilbert/recaptcha.
  3. In app/config/packages/greggilbert/recaptcha/config.php, enter your reCAPTCHA public and private keys.
  4. Add the following line into app/lang/[lang]/validation.php:
    "recaptcha" => 'The :attribute field is not correct.',

Usage

  1. In your form, use Form::captcha() to echo out the markup.
  2. In your validation rules, add the following:
    $rules = array(
        // ...
        'recaptcha_response_field' => 'required|recaptcha',
    };

It's also recommended to add required when validating., (*3)

Customization

reCAPTCHA allows for customization of the widget through a number of options, listed at the official documentation. You can configure the output of the captcha in several ways., (*4)

In the config.php, you can create an options array to set the default behavior. For example:, (*5)

    // ...
    'options' => array(
        'theme' => 'white',
    ),

would default all the reCAPTCHAs to the white theme. If you want to further customize, you can pass options through the Form option:, (*6)

echo Form::captcha(array('theme' => 'blackglass'));

Alternatively, if you want to set a default template instead of the standard one, you can use the config:, (*7)

    // ...
    'template' => 'customCaptcha',

or you can pass it in through the Form option:, (*8)

echo Form::captcha(array('template' => 'customCaptcha'));

Options passed into Form::captcha will always supercede the configuration., (*9)

To change the language of the captcha, simply pass in a language as part of the options:, (*10)

    'options' => array(
        'lang' => 'fr',
    ),

You can do this both in the config and through the Form::captcha() call., (*11)

V2 (No CAPTCHA reCAPTCHA) Support

To make use of the new reCAPTCHA (see https://developers.google.com/recaptcha/docs/display), you will need to enable the v2 setting in the config:, (*12)

    // ...
    'v2' => true,

Note that you will also have to generate a new set of keys if you have previously used reCAPTCHA v1. You can request keys at: https://www.google.com/recaptcha/admin#list, (*13)

The validation rules will also need to be modified to the below:, (*14)

    $rules = array(
        // ...
        'g-recaptcha-response' => 'required|recaptcha',
    };

Limitation

Because of Google's way of displaying the recaptcha, this package won't work if you load your form from an ajax call. If you need to do it you should use that method provided by Google :, (*15)

The Versions

06/12 2014

dev-master

9999999-dev http://github.com/bodeezy/recaptcha

reCAPTCHA Validator for Laravel 4

  Sources   Download

MIT

The Requires

 

by Greg Gilbert

laravel captcha laravel4 recaptcha

05/12 2014

1.1.0

1.1.0.0 http://github.com/greggilbert/recaptcha

reCAPTCHA Validator for Laravel 4

  Sources   Download

MIT

The Requires

 

by Greg Gilbert

laravel captcha laravel4 recaptcha

04/03 2014

dev-develop

dev-develop http://github.com/greggilbert/recaptcha

reCAPTCHA Validator for Laravel 4

  Sources   Download

MIT

The Requires

 

by Greg Gilbert

laravel captcha laravel4 recaptcha

04/03 2014

1.0.7

1.0.7.0 http://github.com/greggilbert/recaptcha

reCAPTCHA Validator for Laravel 4

  Sources   Download

MIT

The Requires

 

by Greg Gilbert

laravel captcha laravel4 recaptcha

28/11 2013

1.0.6

1.0.6.0 http://github.com/greggilbert/recaptcha

reCAPTCHA Validator for Laravel 4

  Sources   Download

MIT

The Requires

 

by Greg Gilbert

laravel captcha laravel4 recaptcha

25/08 2013

1.0.5

1.0.5.0 http://github.com/greggilbert/recaptcha

reCAPTCHA Validator for Laravel 4

  Sources   Download

MIT

The Requires

 

by Greg Gilbert

laravel captcha laravel4 recaptcha

19/06 2013

1.0.4

1.0.4.0 http://github.com/greggilbert/recaptcha

reCAPTCHA Validator for Laravel 4

  Sources   Download

MIT

The Requires

 

by Greg Gilbert

laravel captcha laravel4 recaptcha

04/06 2013

1.0.3

1.0.3.0 http://github.com/greggilbert/recaptcha

reCAPTCHA Validator for Laravel 4

  Sources   Download

MIT

The Requires

 

by Greg Gilbert

laravel captcha laravel4 recaptcha

01/06 2013

1.0.2

1.0.2.0 http://github.com/greggilbert/recaptcha

reCAPTCHA Validator for Laravel 4

  Sources   Download

MIT

The Requires

 

by Greg Gilbert

laravel captcha laravel4 recaptcha

13/05 2013

1.0.1

1.0.1.0 http://github.com/greggilbert/recaptcha

reCAPTCHA Validator for Laravel 4

  Sources   Download

MIT

The Requires

 

by Greg Gilbert

laravel captcha laravel4 recaptcha

27/04 2013

1.0

1.0.0.0 http://github.com/greggilbert/recaptcha

reCAPTCHA Validator for Laravel 4

  Sources   Download

MIT

The Requires

 

by Greg Gilbert

laravel captcha laravel4 recaptcha