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 share your locat... omg In this tutorial we will take a look on how to share your locat...
How to download and ins... omg What is Zoom? Zoom Video Caller is an application for video me...
How to enable dark mode... omg For while now most of companies are going forward with enabling...
How to create a bootabl... omg In this article we will take a look on how to create a bootable...
lHow to install TablePl... omg In this article we will take alook on new Database IDE called T...
How to enable dark mode... omg In this article we will take a look on how to enable dark mode ...