Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.

Get Started Now!

How to Add Google reCAPTCHA on Sing Up & Sing in page in Laravel Php framework

First let’s go to your laravel project and run this Command on Git Bash Ya TERMINAL

Next step we have to install anhskohbo/no-captcha package for Google reCaptcha code, after install these package we able to generate captcha code in our register and login page. copy below code and paste in your terminal

composer require anhskohbo/no-captcha

Next add below code in provider path in config/app.php path

Anhskohbo\NoCaptcha\NoCaptchaServiceProvider::class,

Next Set Google SITE KEY SECRET KEY

Now go to set google secret key and google site key. if you are new user then you have to create from here. go through below link
Please Click Here => https://www.google.com/recaptcha/admin/create

After submit this form you’ll get site key and secret key

Now go to .env file and add this two Code

#########Google Recaptcha NOCAPTCHA_SITEKEY=your site key NOCAPTCHA_SECRET=your secret key

Next go to Route/web.php and add Auth::routes();

Auth::routes();

Go to Route/web.php

Next go to Your Controller.php & your function and add this Code

‘g-recaptcha-response’ => ‘required|captcha’,

Next go to Your blade.php file and add below script

{!! NoCaptcha::renderJs() !!}

And last step of the go to Your blade.php file and add google captcha code before the Sing up & Sing In button

Now refresh & c cache, v clear your browser and you can see google captcha code successfully added in your register page.

Now your TERMINAL This Command

Related Posts

How to Deploy a Laravel Project on a Linux Server Using HTDOCS and GitHub – Complete Step-by-Step Guide

Deploying a Laravel project on a Linux server becomes simple when you follow a structured process. In this guide, we will deploy a Laravel project by cloning Read More

Read More

How to Install and Enable GMP Extension in XAMPP PHP on Linux (Step-by-Step Guide)

Introduction If you are using XAMPP PHP on a Linux server and encounter errors like: then this usually means the GMP extension is not installed, not just Read More

Read More

How to Run an HTML Website Alongside a Laravel Project on the Same Server

Running a Laravel application is common for dynamic web platforms, dashboards, and APIs. However, many businesses and developers also want to run a simple HTML website on Read More

Read More
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x