2017 © Pedro Peláez
 

library grecaptcha

Google Recaptcha Utilities

image

mmilidoni/grecaptcha

Google Recaptcha Utilities

  • Thursday, July 27, 2017
  • by mmilidoni
  • Repository
  • 1 Watchers
  • 1 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

laravel-grecaptcha

This package allows an easily management of Google Recaptcha on your Laravel projects., (*1)

Prerequisites

Google Recaptcha V2 site key and secret key available on ReCAPTCHA website, (*2)

Installation

composer require "mmilidoni/grecaptcha:dev-master", (*3)

Configuration

Add your Recaptcha site key and secret key on config/services.php, (*4)

"grecaptcha" => [
        "secret" => "*****",
        "sitekey" => "****",
    ],

View

Insert the following line on your HTML header, (*5)

<script src='https://www.google.com/recaptcha/api.js'></script>

Insert the following line on your HTML form, (*6)

<div class="g-recaptcha" data-sitekey="{{ config("services.grecaptcha.sitekey") }}"></div>

Controller

use Mmilidoni\Grecaptcha\Grecaptcha;

class Example {
    public function store(\Illuminate\Http\Request $request) {
      $a = new Grecaptcha;
      if ($a->check($request)) {
        // Recaptcha OK
      } else {
        // Recaptcha KO
      }
    }
}

The Versions

27/07 2017

dev-master

9999999-dev

Google Recaptcha Utilities

  Sources   Download

Apache Licence 2.0

by Michele Milidoni