Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

How to enable Google reCaptcha with Laravel?

Step 1 – First go to https://www.google.com/recaptcha/intro/v3.html then click on Admin console

Step 2 – Genereate new recaptcha (click on + button to create)

  1. Type label name
  2. Select ReCaptcha v2 ► select “I’m not a robot” Checkbox
  3. Domains (localhost) or your website address eg www.example.com
  4. Accept the ReCaptcha term of service ( tick checkbox)
  5. send alerts to owners (tick checkbox already) ► click on submit button

Step 3 – after that you will see site key – like this
(6LdtjbYUAAAAANm-tqllPU_O-rHyZ-0HwR0COkYk)

Step 4 – and secret key like this (6LdtjbYUAAAAABDNEWDL2EgBN2pq76AdgHQoLx77)

Step 5 – copy both keys in notepad.

Step 6 -Put below javascript code in resources/views/layouts/app.blade.php

Step 7 – and put below code in your form area above submit button

@if(errors->has(‘g-recaptcha-response’))

{{$errors->first(‘g-captcha-response’)}}

@endif

Step 8 – open any terminal like gitbash or PowerShell and type this command (composer require google/recaptcha ‘~1.1’ press enter
► then run command php artisan make:rule Captcha (press enter)
► then open app/Rules/Captcha.php and add below lines

use ReCaptcha\ReCaptcha;

► and add below codes to Captcha.php

public function passes($attribute, $value)
{
$recaptcha = new ReCaptcha(env(‘CAPTCHA_SECRET’));
$response = $recaptcha->verify($value, $_SERVER[‘REMOTE_ADDR’]);
return $response->isSuccess();
}
—–
public function message()
{
return ‘Please complete the recaptcha to submit the form’;
}

Step 9 – and add below lines to app/Http/User/JobController.php

use App\Rules\Captcha;

Step 10 – and add under validator ‘g-captcha-response’ => new Captcha(),

If you have any query then comment us we will solve your issue and give you also some awesome steps and tricks to solve it. Please follow us for future reference on other topics like PHP, Laravel and other languages.

For More reference Please check this out :

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
MotoShare.in provides the perfect two-wheeler for every occasion—daily commuting, weekend escapes, tourist exploration, or test-riding your dream bike. Simplify your mobility with us!

Related Posts

What is Laravel and use cases of Laravel?

What is Laravel? Laravel is an open-source, free PHP web framework designed for the development of web applications following the model-view-controller (MVC) architectural pattern. It was generated…

Read More

Complete guide of Laravel certification courses, tutorials & training

What is Laravel Laravel is a reliable and simple to use open-source PHP framework. It adheres to the model-view-controller pattern of design. Laravel makes use of pre-existing…

Read More

Top 100 laravel interview questions and answers

1) What is Laravel? Laravel is an open-source widely used PHP framework. The platform was intended for the development of web application by using MVC architectural pattern….

Read More

[SOLVED] Laravel : Supervisor FATAL/BACKOFF Exited too quickly (process log may have details)

Problem I’m trying to use Laravel queues with a supervisor but the service is not working properly. When I try to check status:$ sudo supervisorctl status$ laravel-worker:laravel-worker_00:…

Read More

How to Login with Token in Laravel PHP Framework?

How to Login with Token in Laravel PHP Framework? Step 1. Create a new Project, so write down the following command on Git Bash: Step 2. Move…

Read More

Directory Structure Of Laravel Application

devopsschool – This is Project Folder app – The app directory contains the core code of your application. bootstrap – The bootstrap directory contains the app.php file…

Read More