Simple reCAPTCHA v3 integration

v1.2.0 2020-06-01 12:36 UTC


Latest Version on Packagist Build Status StyleCI Quality Score Total Downloads

This repository contains simple reCAPTCHA v3 integration for your Laravel application.


You can install the package via composer:

composer require torralbodavid/simple-recaptcha-v3


  1. Set the following variables in your .env

Override xxxxx with your reCaptcha v3 keys. Get yours here


Optionally, you can publish the config file of the package. You will be able to customize advanced settings, such as:

  • Disabling reCaptcha v3
  • Minimum score you should get in order to validate your form
  • Hostname validation
  • Hide reCaptcha badge
  • Prefer navigator language on reCaptcha badge
php artisan vendor:publish --provider="Torralbodavid\SimpleRecaptchaV3\SimpleRecaptchaV3ServiceProvider" --tag=config
  1. To get started, you must include at the very bottom of your head tag from the pages you want to protect with reCaptcha, the @captcha_init blade directive. This will start loading Google reCAPTCHA API.
  1. Include below your form initialization tag, the @captcha('xxxx') blade directive. Replace xxxx with your desired action.
    <form method="..." action="...">
  1. To sum up, add the following rule on your form validation:
    'recaptcha_response' => new Captcha
    use Torralbodavid\SimpleRecaptchaV3\Rules\Captcha;
        'recaptcha_response' => new Captcha,

Customize error messages

You can customize reCaptcha v3 error messages by publishing the translations on your project.

php artisan vendor:publish --provider="Torralbodavid\SimpleRecaptchaV3\SimpleRecaptchaV3ServiceProvider" --tag=lang

Customize snippets

You can customize @captcha and @captcha_init snippets by publishing the views on your project

php artisan vendor:publish --provider="Torralbodavid\SimpleRecaptchaV3\SimpleRecaptchaV3ServiceProvider" --tag=views

Disable reCaptcha v3 integration in tests

You can easily disable reCaptcha v3 integration in your tests by adding the following configuration on them

config()->set('', false);


composer test


Please see CHANGELOG for more information what has changed recently.


Please see CONTRIBUTING for details.


If you discover any security related issues, please email instead of using the issue tracker.



The MIT License (MIT). Please see License File for more information.

Have fun!