PHPackages                             internetguru/laravel-recaptchav3 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. internetguru/laravel-recaptchav3

ActiveLibrary[Security](/categories/security)

internetguru/laravel-recaptchav3
================================

Recaptcha V3 for Laravel package

v1.1.8(3mo ago)03.6k↑90%1MITPHPPHP ^8.4CI passing

Since Feb 28Pushed 1mo agoCompare

[ Source](https://github.com/internetguru/laravel-recaptchav3)[ Packagist](https://packagist.org/packages/internetguru/laravel-recaptchav3)[ RSS](/packages/internetguru-laravel-recaptchav3/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (25)Used By (1)

Laravel Recaptcha V3
====================

[](#laravel-recaptcha-v3)

[![Build Status](https://github.com/josiasmontag/laravel-recaptchav3/actions/workflows/run-tests.yml/badge.svg)](https://github.com/josiasmontag/laravel-recaptchav3/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/955dda8b7d8fce2021879a241954bdea87ebf0c634ef8dc1dabde364452fb38d/68747470733a2f2f706f7365722e707567782e6f72672f6a6f736961736d6f6e7461672f6c61726176656c2d72656361707463686176332f642f746f74616c2e737667)](https://packagist.org/packages/josiasmontag/laravel-recaptchav3)[![Latest Stable Version](https://camo.githubusercontent.com/22ce8d1696311c7ba89f85f83fda99862b5201557ee443ad339adaf551c14b64/68747470733a2f2f706f7365722e707567782e6f72672f6a6f736961736d6f6e7461672f6c61726176656c2d72656361707463686176332f762f737461626c652e737667)](https://packagist.org/packages/josiasmontag/laravel-recaptchav3)[![License](https://camo.githubusercontent.com/901f653db7bed2c092647acbc1acd3c55cb867924e95229296b668d81f11acb5/68747470733a2f2f706f7365722e707567782e6f72672f6a6f736961736d6f6e7461672f6c61726176656c2d72656361707463686176332f6c6963656e73652e737667)](https://packagist.org/packages/josiasmontag/laravel-recaptchav3)

Laravel package for Google's [Recaptcha V3](https://developers.google.com/recaptcha/docs/v3). This is a lightweight package which focuses on the backend validation of Recaptcha V3 captchas.

Installation
------------

[](#installation)

To get started, use Composer to add the package to your project's dependencies:

```
composer require josiasmontag/laravel-recaptchav3

```

Add `RECAPTCHAV3_SITEKEY` and `RECAPTCHAV3_SECRET` to your `.env` file. (You can get them [here](https://www.google.com/recaptcha/admin#list))

```
RECAPTCHAV3_SITEKEY=sitekey
RECAPTCHAV3_SECRET=secret

```

Optionally, you can publish the config file:

```
php artisan vendor:publish --provider="Lunaweb\RecaptchaV3\Providers\RecaptchaV3ServiceProvider"

```

Usage
-----

[](#usage)

#### Init Recaptcha Javascript

[](#init-recaptcha-javascript)

Recaptcha v3 works best when it is loaded on every page to get the most context about interactions. Therefore, add to your header or footer template:

```
{!! RecaptchaV3::initJs() !!}
```

#### Forms

[](#forms)

`RecaptchaV3::field($action, $name='g-recaptcha-response')` creates an invisible input field that gets filled with a Recaptcha token on load.

```

    {!! RecaptchaV3::field('register') !!}

```

#### Validation

[](#validation)

Add the `recaptchav3` validator to the rules array. The rule accepts two parameters: The `action` name and the minimum required `score` (defaults to 0.5).

```
$validate = Validator::make(Input::all(), [
	'g-recaptcha-response' => 'required|recaptchav3:register,0.5'
]);
```

#### Getting the score

[](#getting-the-score)

Alternatively, you can get the score and take variable action:

```
// Import the facade class
use Lunaweb\RecaptchaV3\Facades\RecaptchaV3;
//  RecaptchaV3::verify($token, $action)
$score = RecaptchaV3::verify($request->get('g-recaptcha-response'), 'register')
if($score > 0.7) {
    // go
} elseif($score > 0.3) {
    // require additional email verification
} else {
    return abort(400, 'You are most likely a bot');
}
```

#### Custom validation error message

[](#custom-validation-error-message)

Add the following values to the `custom` array in the `validation` language file:

```
'custom' => [
    'g-recaptcha-response' => [
        'recaptchav3' => 'Captcha error message',
    ],
],
```

#### Hiding the ReCAPTCHA Badge

[](#hiding-the-recaptcha-badge)

Add to your CSS file:

```
.grecaptcha-badge { visibility: hidden !important; }
```

#### Localization

[](#localization)

By default, the package follows the default application locale, which is defined in `config/app.php`. If you want to change this behavior, you can specify what locale to use by adding a new environment variable :

```
RECAPTCHAV3_LOCALE=ar

```

#### Testing

[](#testing)

To make your forms testable, you can mock the `RecaptchaV3` facade:

```
RecaptchaV3::shouldReceive('verify')
    ->once()
    ->andReturn(1.0);
```

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance85

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Recently: every ~0 days

Total

18

Last Release

113d ago

Major Versions

v0.1.0 → v1.0.02025-12-02

PHP version history (2 changes)v0.0.0PHP &gt;=7.1.0

v0.1.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/b52abb7d16d42d5abe09b797fc4da8186dc507caf8a62f4e1b88b0448edca4f8?d=identicon)[internetguru](/maintainers/internetguru)

---

Top Contributors

[![josiasmontag](https://avatars.githubusercontent.com/u/1945577?v=4)](https://github.com/josiasmontag "josiasmontag (19 commits)")[![petrzpav](https://avatars.githubusercontent.com/u/1113912?v=4)](https://github.com/petrzpav "petrzpav (12 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (3 commits)")[![tderick](https://avatars.githubusercontent.com/u/81715817?v=4)](https://github.com/tderick "tderick (2 commits)")[![bondif](https://avatars.githubusercontent.com/u/24433897?v=4)](https://github.com/bondif "bondif (1 commits)")[![Joeri-KIXX](https://avatars.githubusercontent.com/u/38066185?v=4)](https://github.com/Joeri-KIXX "Joeri-KIXX (1 commits)")

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/internetguru-laravel-recaptchav3/health.svg)

```
[![Health](https://phpackages.com/badges/internetguru-laravel-recaptchav3/health.svg)](https://phpackages.com/packages/internetguru-laravel-recaptchav3)
```

###  Alternatives

[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[soved/laravel-gdpr

GDPR compliance with ease

299127.5k2](/packages/soved-laravel-gdpr)[masterro/laravel-xss-filter

Filter user input for XSS but don't touch other html

41254.5k](/packages/masterro-laravel-xss-filter)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)[nickurt/laravel-pwned-passwords

PwnedPasswords for Laravel 11.x/12.x/13.x

187.5k](/packages/nickurt-laravel-pwned-passwords)[dgtlss/owaspadvisor

A Laravel package to help developers implement OWASP Top 10 security guidelines

327.1k](/packages/dgtlss-owaspadvisor)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
