google-recaptcha-laravel

Google reCAPTCHA Implementation in Laravel 5.3

Developing secure web application you need to use captcha. For this purpose Google reCAPTCHA is very useful and integration is simple. In my previous post Contact Form With Google reCAPTCHA in PHP explains reCAPTCHA implementation using PHP. In this article explains how to implement Google  reCAPTCHA in Laravel 5.3.

Step 1 : Installation

Step 2 : Register library (config/app.php)

Step 3 : Set Google Site Key

For site key you need to register website from https://www.google.com/recaptcha/admin#list 

Step 4 : Put site key and secret key (.env)

Add following lines in .env file and put site key and secret key

Step 5 : Routing (app/Http/routes.php)

Step 6 : Captcha controller

app/Http/Controllers/RecaptchaController.php

Step 7 : View

resources/views/recaptcha.blade.php

Sample Screen shorts :

google-recaptcha1

 

google-recaptcha2