How to apply Invisible reCAPTCHA on your laravel application?

Zaid Jaber by Zaid Jaber
How to apply Invisible reCAPTCHA on your laravel application?

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

 

AlbertCht\InvisibleReCaptcha\InvisibleReCaptchaServiceProvider::class,

 

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

 

INVISIBLE_RECAPTCHA_SITEKEY=<siteKey>

INVISIBLE_RECAPTCHA_SECRETKEY=<secretKey>

INVISIBLE_RECAPTCHA_BADGEHIDE=false

INVISIBLE_RECAPTCHA_DATABADGE='bottomright'

INVISIBLE_RECAPTCHA_TIMEOUT=5

INVISIBLE_RECAPTCHA_DEBUG=false

 

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

 

@captcha()

 

inside the controller you must validate the recaptcha by adding the following

 

$this->validate($request, [

'g-recaptcha-response' => 'required|captcha'

]);

 

That's it :D 

 

Follow me @zaidjaber

Category: How To

Comments (0)

Read More

How to enable Dark Mode... omg In this article we will be taking a look on how to enable dar...
How to enable Audio des... omg In this article we will take alook on how to eale audio descri...
How to disable GPS loca... omg In this article we will take alook on how to disable the GPS lo...
How to install Signal P... omg In this article we will take alook on how to install signal pri...
How to delete Imo Accou... omg In this article we will take alook on how to delete yout Imo Ac...
How to share your locat... omg In this tutorial we will take a look on how to share your locat...