PHPackages                             sushantaryal/laravel-recaptcha - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. sushantaryal/laravel-recaptcha

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

sushantaryal/laravel-recaptcha
==============================

A Laravel package to validate google recaptcha v3

1.0.1(9mo ago)00MITPHPPHP ^8.1

Since Jun 16Pushed 9mo agoCompare

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

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

Google Recaptcha v3 Validation for Laravel
==========================================

[](#google-recaptcha-v3-validation-for-laravel)

A Laravel package for validating **Google Recaptcha v3**.

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

[](#installation)

You can install the package via Composer:

```
composer require sushantaryal/laravel-recaptcha
```

Getting reCAPTCHA keys
----------------------

[](#getting-recaptcha-keys)

Follow the [official documentation](https://www.google.com/recaptcha/admin/create) to get the reCAPTCHA site key and secret key.

Configuration
-------------

[](#configuration)

Add these to your `.env`:

```
RECAPTCHA_KEY=
RECAPTCHA_SECRET=
RECAPTCHA_THRESHOLD=0.5
```

Usage
-----

[](#usage)

### Form

[](#form)

Follow the [official documentation](https://developers.google.com/recaptcha/docs/v3) to get the reCAPTCHA HTML code.

### Automatically bind the challenge to a button

[](#automatically-bind-the-challenge-to-a-button)

```

```

Add a callback function to handle the token.

```

    function onSubmit(token) {
        document.getElementById("demo-form").submit();
    }

```

Add attributes to your html button.

```

    Submit

```

#### OR

[](#or)

### Programmatically invoke the challenge

[](#programmatically-invoke-the-challenge)

Use the `` in your form.

```

    @csrf

    Submit

```

Load the JavaScript with the recaptcha blade component before closing body tag.

```

    ...

```

### Backend

[](#backend)

You can use the `Recaptcha` rule in your validation rules:

```
use Sushant\LaravelRecaptcha\Rules\Recaptcha;

$request->validate([
    'g-recaptcha-response' => ['required', new Recaptcha()],
]);
```

License
-------

[](#license)

[MIT license](LICENSE.md).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance56

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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 ~37 days

Total

2

Last Release

294d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/05c907e2aa7e31ac496a8c30eac50e735157cda263dd728187527b2f6771eb86?d=identicon)[sushantaryal8](/maintainers/sushantaryal8)

---

Top Contributors

[![sushantaryal](https://avatars.githubusercontent.com/u/8115655?v=4)](https://github.com/sushantaryal "sushantaryal (3 commits)")

---

Tags

laravelvalidationrecaptcha

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sushantaryal-laravel-recaptcha/health.svg)

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

###  Alternatives

[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k35.7M107](/packages/propaganistas-laravel-phone)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

759569.4k13](/packages/wendelladriel-laravel-validated-dto)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)[galahad/laravel-addressing

Laravel package providing addressing functionality

70316.6k](/packages/galahad-laravel-addressing)

PHPackages © 2026

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