In this tutorial we will take alook on how to to apply invisible google reCAPTCHA on a laravel application hope you enjoy it.
Step 1: We will create a brand new laravel application by typing the following command on your terminal
~$ composer create-project laravel/laravel recaptcha
~# cd recaptcha/
Step 2: We will strat installing invisible google package from github.com by typing the following command on the terminal:
go to github.com and search for albertcht/invisible-recaptcha to find more.
~$ composer require albertcht/invisible-recaptcha
Step 3: Setup the recaptcha on laravel 5
Add ServiceProvider to the providers array in config/app.php
Step 4: Configuring reCAPTCHA
You have to create your keys by visiting https;//www.google.com/recaptcha ,and go to <admin console>
Step 5: Adding keys
In your .env file add the following
Step 6: How to use
Create the form your wishing to add reCAPTCHA between the <form></form> add this in the blade to render your recaptcha
inside the controller you must validate the recaptcha by adding the following
'g-recaptcha-response' => 'required|captcha'
That's it :D
Follow me @zaidjaber
Category: How To