New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

cohensive/recaptcha

Laravel 4 bridge for recaptcha/php5
138
Install
composer require cohensive/recaptcha
Latest Version:4.0.0
PHP:>=5.3.0
License:BSD-3-Clause
Last Updated:Oct 26, 2014
Links: GitHub  ·  Packagist
Maintainer: KaneCohen

reCaptcha for Laravel 4

Installation

Add following require to your composer.json file:

    "cohensive/recaptcha": "dev-master"

Then run composer install or composer update to download it and autoload.

In providers array you need to add new package:

'providers' => array(

    //...
    'Cohensive\Recaptcha\RecaptchaServiceProvider',
    //...

)

In aliases:

'aliases' => array(

    //...
    'Recaptcha' => 'Cohensive\Recaptcha\Facades\Recaptcha'
    //...

)

And after all that, we need to add config file, which will hold our private and public keys. Run following line in command line:

    php artisan config:publish cohensive/recaptcha

Your public and private key could be found in Google reCaptcha account page.

Usage

Insert Recaptcha javascript code into your page (check your Google reCaptcha account).

Then, all you need is to insert a new rule to your validator on your POST processing page:

  return [
    'recaptcha_response_field' => 'recaptcha'
  ];

recaptcha rule can be added to any input attribute, just make sure to translate it correcly in your language file.

Related Packages

josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2,382,112 268
buzz/laravel-google-captcha

Google captcha for Laravel

1,193,246 208
saasykit/laravel-recaptcha

Simple and painless Google reCAPTCHA package for Laravel framework

180,859 0
javaabu/laravel-recaptcha

Simple and painless Google reCAPTCHA package for Laravel framework

9,820 0
goedemiddag/laravel-recaptcha

A simple and easy to use Google ReCaptcha v3 package for Laravel

8,008 2

Version History

Version Released PHP License
4.0.0 >=5.3.0 BSD-3-Clause