PHPackages                             goedemiddag/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. goedemiddag/laravel-recaptcha

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

goedemiddag/laravel-recaptcha
=============================

A simple and easy to use Google ReCaptcha v3 package for Laravel

v1.1.0(1y ago)25.6k↑233.3%MITPHPPHP ^8.1CI passing

Since May 28Pushed 1y ago3 watchersCompare

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

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

Laravel ReCAPTCHA
=================

[](#laravel-recaptcha)

This is a Laravel package for Google reCAPTCHA v3.

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

[](#installation)

You can install the package via composer:

```
composer require goedemiddag/laravel-recaptcha
```

Add the following environment variables to your `.env` file:

```
RECAPTCHA_SITE_KEY=YOUR_SITE_KEY
RECAPTCHA_SECRET_KEY=YOUR_SECRET_KEY
RECAPTCHA_THRESHOLD=0.3
```

### Config

[](#config)

You can optionally publish the config file:

```
php artisan vendor:publish --provider="Goedemiddag\ReCaptcha\ReCaptchaServiceProvider" --tag="recaptcha-config"
```

This is the contents of the published config file:

```
return [
    'site_key' => env('RECAPTCHA_SITE_KEY'),
    'secret_key' => env('RECAPTCHA_SECRET_KEY'),

    // The threshold to pass the recaptcha validation, from 0 (easiest) to 1 (hardest)
    'threshold' => env('RECAPTCHA_THRESHOLD', 0.3),

    // Provide IP addresses that shouldn't be validated
    'skip_ips' => [
        // 127.0.0.1
    ],
];
```

### Translations

[](#translations)

This package offers Dutch and English translations by default. You can optionally publish the translations:

```
php artisan vendor:publish --provider="Goedemiddag\ReCaptcha\ReCaptchaServiceProvider" --tag="recaptcha-lang"
```

Usage
-----

[](#usage)

This package aims to provide the Google ReCaptcha v3 validation in the backend of your application and offers some tools to use it in the frontend.

### Quick start

[](#quick-start)

Add the `` blade component to your form:

```

    @csrf

    ...

    Submit

```

Add the `` blade component to your end of your layout:

```

    ...page content...

```

Bind an event listener to the form submit event, please adjust this for your application:

```
document.querySelector('form').addEventListener('submit', function (event) {
    event.preventDefault();

    window.reCaptcha.render('submit', function (token) {
        // Set token value
        event.target.querySelector('input[name="g-recaptcha-response"]').value = token;

        // Submit form
        event.target.submit();
    });
});
```

Add the `ReCaptchaRule` to your form request:

```
public function rules(): array
{
    return [
        'g-recaptcha-response' => ['required', new ReCaptchaRule()],
    ];
}
```

Contributing
------------

[](#contributing)

Found a bug or want to add a new feature? Great! There are also many other ways to make meaningful contributions such as reviewing outstanding pull requests and writing documentation. Even opening an issue for a bug you found is appreciated.

When you create a pull request, make sure it is tested, following the code standard (run `composer pint:fix` to take care of that for you) and please create one pull request per feature. In exchange, you will be credited as contributor.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance44

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.1% 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 ~138 days

Total

3

Last Release

445d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11698012?v=4)[Goedemiddag!](/maintainers/Goedemiddag)[@goedemiddag](https://github.com/goedemiddag)

---

Top Contributors

[![dvdheiden](https://avatars.githubusercontent.com/u/90568118?v=4)](https://github.com/dvdheiden "dvdheiden (8 commits)")[![dcmastenbroek](https://avatars.githubusercontent.com/u/31538560?v=4)](https://github.com/dcmastenbroek "dcmastenbroek (5 commits)")[![bonroyage](https://avatars.githubusercontent.com/u/4411748?v=4)](https://github.com/bonroyage "bonroyage (1 commits)")

---

Tags

phplaravelrecaptchacaptcha

###  Code Quality

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[albertcht/invisible-recaptcha

Invisible reCAPTCHA For Laravel.

6031.6M6](/packages/albertcht-invisible-recaptcha)[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[buzz/laravel-google-captcha

Google captcha for Laravel

2071.1M2](/packages/buzz-laravel-google-captcha)[arcanedev/no-captcha

No CAPTCHA (new Google reCAPTCHA) with Laravel support

370730.4k6](/packages/arcanedev-no-captcha)

PHPackages © 2026

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