PHPackages                             phoenix22h/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. phoenix22h/laravel-recaptchav3

ActiveLibrary[Security](/categories/security)

phoenix22h/laravel-recaptchav3
==============================

Recaptcha V3 for Laravel package

1.0.2(2y ago)019MITPHPPHP &gt;=7.1.0

Since Oct 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Phoenix-H22/laravel-recaptchav3)[ Packagist](https://packagist.org/packages/phoenix22h/laravel-recaptchav3)[ Docs](https://github.com/Phoenix-H22/laravel-recaptchav3)[ RSS](/packages/phoenix22h-laravel-recaptchav3/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (7)Versions (4)Used By (0)

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

[](#laravel-recaptcha-v3)

[![Build Status](https://github.com/phoenix22h/laravel-recaptchav3/actions/workflows/run-tests.yml/badge.svg)](https://github.com/phoenix22h/laravel-recaptchav3/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/190ffb3ffb47f84b53a07226c69b915eb4d3a4c2f86a7c13279b4d64bd741f4d/68747470733a2f2f706f7365722e707567782e6f72672f70686f656e69783232682f6c61726176656c2d72656361707463686176332f642f746f74616c2e737667)](https://packagist.org/packages/phoenix22h/laravel-recaptchav3)[![Latest Stable Version](https://camo.githubusercontent.com/564c054b94b8c64b73f384e185dcd0ecc194b4123471112e07c92f78b8913add/68747470733a2f2f706f7365722e707567782e6f72672f70686f656e69783232682f6c61726176656c2d72656361707463686176332f762f737461626c652e737667)](https://packagist.org/packages/phoenix22h/laravel-recaptchav3)[![License](https://camo.githubusercontent.com/fb1929d9d3ef72161bb90b42c9e233dcc784a2c0917344ab9bb0dec5a828f1dc/68747470733a2f2f706f7365722e707567782e6f72672f70686f656e69783232682f6c61726176656c2d72656361707463686176332f6c6963656e73652e737667)](https://packagist.org/packages/phoenix22h/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 phoenix22h/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="Phoenix22h\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 Phoenix22h\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

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~50 days

Total

3

Last Release

887d ago

### Community

Maintainers

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

---

Top Contributors

[![Phoenix-H22](https://avatars.githubusercontent.com/u/51987014?v=4)](https://github.com/Phoenix-H22 "Phoenix-H22 (7 commits)")

---

Tags

phplaravelrecaptchacaptcha

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.4k](/packages/larastan-larastan)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2701.9M2](/packages/josiasmontag-laravel-recaptchav3)

PHPackages © 2026

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