PHPackages                             hedii/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. hedii/laravel-recaptcha

ActiveLibrary

hedii/laravel-recaptcha
=======================

Google reCAPTCHA v3 for Laravel

3.0.1(4y ago)455.5kMITPHPPHP ^8.0

Since Mar 21Pushed 4y ago1 watchersCompare

[ Source](https://github.com/hedii/laravel-recaptcha)[ Packagist](https://packagist.org/packages/hedii/laravel-recaptcha)[ RSS](/packages/hedii-laravel-recaptcha/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (3)Versions (9)Used By (0)

[![Build Status](https://github.com/hedii/laravel-recaptcha/workflows/Tests/badge.svg)](https://github.com/hedii/laravel-recaptcha/actions)[![Total Downloads](https://camo.githubusercontent.com/ea68a0b6f957b913b77781349d0c1623a04f2f69ea0a38e794ceb768b6718287/68747470733a2f2f706f7365722e707567782e6f72672f68656469692f6c61726176656c2d7265636170746368612f646f776e6c6f616473)](//packagist.org/packages/hedii/laravel-recaptcha)[![License](https://camo.githubusercontent.com/39252a49430dd8b5ca541ca984d1a8206025f1f6c0825ba36f04e69b4550439c/68747470733a2f2f706f7365722e707567782e6f72672f68656469692f6c61726176656c2d7265636170746368612f6c6963656e7365)](https://github.com/hedii/laravel-recaptcha/blob/master/LICENSE.md)[![Latest Stable Version](https://camo.githubusercontent.com/dc449f8cb0b6a4495e57ef18fc3dd2b048658e05ba5446c5b404b001c6199a80/68747470733a2f2f706f7365722e707567782e6f72672f68656469692f6c61726176656c2d7265636170746368612f76)](//packagist.org/packages/hedii/laravel-recaptcha)

Laravel Recaptcha
=================

[](#laravel-recaptcha)

Google reCAPTCHA v3 for Laravel 7.0+

Table of contents
-----------------

[](#table-of-contents)

- [Table of contents](#table-of-contents)
- [Installation](#installation)
- [Usage](#usage)
    - [Example](#example)
- [License](#license)

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

[](#installation)

Install via [composer](https://getcomposer.org/doc/00-intro.md)

```
composer require hedii/laravel-recaptcha
```

Publish the configuration

```
php artisan vendor:publish --provider="Hedii\LaravelRecaptcha\RecaptchaServiceProvider"
```

The configuration file located at `config/recaptcha.php` looks like this:

```
return [
    /**
     * The recaptcha site key.
     */
    'site_key' => env('RECAPTCHA_SITE_KEY', ''),

    /**
     * The recaptcha site secret.
     */
    'secret_key' => env('RECAPTCHA_SECRET_KEY', ''),

    /**
     * The minimum score (from 0.0 to 1.0) a recaptcha response must have to be
     * valid. 1.0 is very likely a good interaction, 0.0 is very likely a bot.
     */
    'minimum_score' => env('RECAPTCHA_MINIMUM_SCORE', 0.7),
];
```

Register a new website on [Google Recaptcha admin](https://www.google.com/recaptcha/admin/create), and select reCAPTCHA v3

Edit `.env` to add the required environment variables

```
RECAPTCHA_SITE_KEY=xxxxxxxxxxxxxxxxxxx
RECAPTCHA_SECRET_KEY=xxxxxxxxxxxxxxxxxxx
RECAPTCHA_MINIMUM_SCORE=0.7

```

Usage
-----

[](#usage)

Insert the required javascript on a html form using the following method. You can set an action name as the first parameter, and the id of the recaptcha hidden html field as a second parameter.

```

    {!! Recaptcha::script('contact_form', 'recaptchaResponse') !!}

```

On your controller, you can verify the recaptcha score like this:

```
public function store(\Hedii\LaravelRecaptcha\Recaptcha $recaptcha)
{
    if (! $recaptcha->isValid()) {
        // the recaptcha score is lower than the configured minimal score, you
        // can throw a validation exception or do anything else
        throw ValidationException::withMessages([
            'recaptcha' => 'Recaptcha validation failed...'
        ]);
    }

    // here the score is valid
}
```

If you prefer to use the Facade:

```
public function store()
{
    if (! Recaptcha::isValid()) {
        // the recaptcha score is lower than the configured minimal score, you
        // can throw a validation exception or do anything else
        throw ValidationException::withMessages([
            'recaptcha' => 'Recaptcha validation failed...'
        ]);
    }

    // here the score is valid
}
```

License
-------

[](#license)

laravel-recaptcha is released under the MIT Licence. See the bundled [LICENSE](https://github.com/hedii/laravel-recaptcha/blob/master/LICENSE.md) file for details.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

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

Recently: every ~131 days

Total

8

Last Release

1529d ago

Major Versions

1.0.1 → 2.0.02020-09-18

2.2.0 → 3.0.02022-03-05

PHP version history (3 changes)1.0.0PHP ^7.4.0

2.1.0PHP ^7.4.0|^8.0

3.0.0PHP ^8.0

### Community

Maintainers

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

---

Top Contributors

[![hedii](https://avatars.githubusercontent.com/u/5358048?v=4)](https://github.com/hedii "hedii (12 commits)")

---

Tags

google-recaptchahediilaravellaravel-recaptchaphprecaptcharecaptcha-v3laravelrecaptchahedii

### Embed Badge

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

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[vemcogroup/laravel-sparkpost-driver

SparkPost driver to use with Laravel 6.x|7.x|8.x|9.x|10.x

421.7M1](/packages/vemcogroup-laravel-sparkpost-driver)[nickurt/laravel-akismet

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

97139.6k2](/packages/nickurt-laravel-akismet)

PHPackages © 2026

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