PHPackages                             homedoctor-es/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. homedoctor-es/recaptcha

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

homedoctor-es/recaptcha
=======================

reCAPTCHA Validator for Laravel 5

3.2.0(2y ago)03.1k↓50%MITPHPPHP &gt;=5.4.1

Since Apr 27Pushed 2y agoCompare

[ Source](https://github.com/homedoctor-es/recaptcha)[ Packagist](https://packagist.org/packages/homedoctor-es/recaptcha)[ Docs](http://github.com/kuttumiah/recaptcha)[ RSS](/packages/homedoctor-es-recaptcha/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (31)Used By (0)

Recaptcha
=========

[](#recaptcha)

A reCAPTCHA Validator for Laravel 5.

This is a forked version of the [reCaptcha package](https://github.com/greggilbert/recaptcha) for same functionality but with support for reCaptcha Version 3.

> (Looking for a Laravel 4 version? Pull the latest 1.x tag. For Laravel 5.0, pull the latest 2.0 tag.)

> For reCaptcha v3 support use `dev-master` from this repository.

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

[](#installation)

Add the following line to the `require` section of `composer.json`:

```
{
    "require": {
        "kuttumiah/recaptcha": "dev-master",
    }
}
```

or run the command below in terminal

```
$ composer require "kuttumiah/recaptcha:dev-master"
```

Setup
-----

[](#setup)

1. If you are using **Laravel 5.5+** and using package auto-discovery, you can skip this step. For older versions or if you have disabled package auto-discovery continue with this step.

    In `/config/app.php`, add the following to `providers`:

    ```
    Kuttumiah\Recaptcha\RecaptchaServiceProvider::class,
    ```

    and the following to `aliases`:

    ```
    'Recaptcha' => Kuttumiah\Recaptcha\Facades\Recaptcha::class,
    ```
2. Run `php artisan vendor:publish --provider="Kuttumiah\Recaptcha\RecaptchaServiceProvider"`.
3. In `/config/recaptcha.php`, enter your reCAPTCHA public and private keys.

    - If you are not using the most recent version of reCAPTCHA, set `version` to 2 or 1.
    - If you are upgrading to v3 of reCAPTCHA, note that your keys from the previous version will not work, and you need to generate a new set in [the reCAPTCHA admin](https://www.google.com/recaptcha/admin).
4. The package ships with a default validation message, but if you want to customize it, add the following line into `resources/lang/[lang]/validation.php`:

    ```
        'recaptcha' => 'The :attribute field is not correct.',
    ```

### Migrating from `greggilbert/recaptcha` package

[](#migrating-from-greggilbertrecaptcha-package)

1. In `/config/app.php`, remove the following from `providers`:

    ```
    Greggilbert\Recaptcha\RecaptchaServiceProvider::class,
    ```

    and the following from `aliases`:

    ```
    'Recaptcha' => Greggilbert\Recaptcha\Facades\Recaptcha::class,
    ```
2. Remove the following line from the `require` section of `composer.json`:

    ```
    {
        "require": {
            "greggilbert/recaptcha": "dev-master",
        }
    }
    ```
3. Run the command below in terminal

    ```
    $ composer update
    ```
4. Follow the [Installation](#installation) and [Setup](#setup) steps.

**Note:** If you face any issue error while migrating please check the [Troubleshoot](#troubleshoot) section.

Usage
-----

[](#usage)

### v2 (No Captcha)

[](#v2-no-captcha)

1. In your form, use `{!! Recaptcha::render() !!}` to echo out the markup.
2. In your validation rules, add the following:

```
    $rules = [
        // ...
        'g-recaptcha-response' => 'required|recaptcha',
    ];
```

### v1 (Legacy)

[](#v1-legacy)

1. In your form, use `{!! Recaptcha::render() !!}` to echo out the markup.
2. In your validation rules, add the following:

```
    $rules = [
        // ...
        'recaptcha_response_field' => 'required|recaptcha',
    ];
```

It's also recommended to add `required` when validating.

Customization
-------------

[](#customization)

reCAPTCHA v2 allows for customization of the widget through a number of options, listed [at the official documentation](https://developers.google.com/recaptcha/docs/display). You can configure the output of the captcha through six allowed keys: `theme`, `type`, `lang`, `callback`, `tabindex` and `expired-callback`.

In the config file, you can create an `options` array to set the default behavior. For example:

```
    // ...
    'options' => [
		'lang' => 'ja',
	],
```

would default the language in all the reCAPTCHAs to Japanese. If you want to further customize, you can pass options through the render option:

```
echo Recaptcha::render([ 'lang' => 'fr' ]);
```

Options passed into `Recaptcha::render` will always supercede the configuration.

### Language

[](#language)

To change the language of the captcha, simply pass in a language as part of the options:

```
    'options' => [
        'lang' => 'fr',
	],
```

For a list of valid language codes, consulting [the official documentation](https://developers.google.com/recaptcha/docs/language).

### Custom template

[](#custom-template)

Alternatively, if you want to set a default template instead of the standard one, you can use the config:

```
    // ...
    'template' => 'customCaptcha',
```

or you can pass it in through the Form option:

```
echo Recaptcha::render([ 'template' => 'customCaptcha' ]);
```

Troubleshoot
------------

[](#troubleshoot)

While migrating from `greggilbert/recaptcha` package you might end up raising an error like below

> &gt; @php artisan package:discover
>
> In ProviderRepository.php line 208:
>
>  Class 'Greggilbert\\Recaptcha\\RecaptchaServiceProvider' not found
>
> Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

To resolve the issue I found a helpful resource on [Stack Overflow](https://stackoverflow.com/a/53705743/2117868) which can fix this issue. Attaching the solution here for convenience.

Go to your `project > bootstrap > cache > config.php` file. Remove the provider and aliases from the cached array manually.

Or simply remove the file and generate again by running the command below,

```
$ php artisan config:cache
```

### v1 customization

[](#v1-customization)

For the v1 customization options, consult [the old documentation](https://developers.google.com/recaptcha/old/docs/customization) and apply accordingly.

Limitation
----------

[](#limitation)

Because of Google's way of displaying the reCAPTCHA, this package won't work if you load your form from an AJAX call. If you need to do it, you should use one of [the alternate methods provided by Google](https://developers.google.com/recaptcha/docs/display?csw=1).

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 60.5% 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 ~141 days

Recently: every ~288 days

Total

28

Last Release

944d ago

Major Versions

1.1.5 → 2.0.02015-02-08

2.2.0 → 3.0.02020-08-11

PHP version history (2 changes)1.0PHP &gt;=5.3.0

3.0.0PHP &gt;=5.4.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d82a7f4fd8f6b4df27e6eb2e83fe0b57ec77c21d4e3082aab51501e928e67fb?d=identicon)[Homedoctor](/maintainers/Homedoctor)

---

Top Contributors

[![greggilbert](https://avatars.githubusercontent.com/u/169482?v=4)](https://github.com/greggilbert "greggilbert (72 commits)")[![theothertomelliott](https://avatars.githubusercontent.com/u/1131428?v=4)](https://github.com/theothertomelliott "theothertomelliott (13 commits)")[![kuttumiah](https://avatars.githubusercontent.com/u/804507?v=4)](https://github.com/kuttumiah "kuttumiah (13 commits)")[![hiddeco](https://avatars.githubusercontent.com/u/10063039?v=4)](https://github.com/hiddeco "hiddeco (4 commits)")[![peterpan666](https://avatars.githubusercontent.com/u/4153168?v=4)](https://github.com/peterpan666 "peterpan666 (2 commits)")[![dereknutile](https://avatars.githubusercontent.com/u/146833?v=4)](https://github.com/dereknutile "dereknutile (1 commits)")[![haleksandre](https://avatars.githubusercontent.com/u/8269937?v=4)](https://github.com/haleksandre "haleksandre (1 commits)")[![HeathNaylor](https://avatars.githubusercontent.com/u/10814256?v=4)](https://github.com/HeathNaylor "HeathNaylor (1 commits)")[![JN-Jones](https://avatars.githubusercontent.com/u/1917879?v=4)](https://github.com/JN-Jones "JN-Jones (1 commits)")[![ChrisReid](https://avatars.githubusercontent.com/u/2385373?v=4)](https://github.com/ChrisReid "ChrisReid (1 commits)")[![lucacri](https://avatars.githubusercontent.com/u/2913531?v=4)](https://github.com/lucacri "lucacri (1 commits)")[![madmpj](https://avatars.githubusercontent.com/u/6883472?v=4)](https://github.com/madmpj "madmpj (1 commits)")[![marcorivm](https://avatars.githubusercontent.com/u/1222598?v=4)](https://github.com/marcorivm "marcorivm (1 commits)")[![mohamed-akef](https://avatars.githubusercontent.com/u/1524321?v=4)](https://github.com/mohamed-akef "mohamed-akef (1 commits)")[![odorisioe](https://avatars.githubusercontent.com/u/2213527?v=4)](https://github.com/odorisioe "odorisioe (1 commits)")[![r4y7s](https://avatars.githubusercontent.com/u/6150209?v=4)](https://github.com/r4y7s "r4y7s (1 commits)")[![simondubois](https://avatars.githubusercontent.com/u/9416595?v=4)](https://github.com/simondubois "simondubois (1 commits)")[![elfif](https://avatars.githubusercontent.com/u/1546817?v=4)](https://github.com/elfif "elfif (1 commits)")[![devinfd](https://avatars.githubusercontent.com/u/468399?v=4)](https://github.com/devinfd "devinfd (1 commits)")[![Gawdl3y](https://avatars.githubusercontent.com/u/279900?v=4)](https://github.com/Gawdl3y "Gawdl3y (1 commits)")

---

Tags

laravelrecaptchacaptchalaravel5

### Embed Badge

![Health badge](/badges/homedoctor-es-recaptcha/health.svg)

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

###  Alternatives

[anhskohbo/no-captcha

No CAPTCHA reCAPTCHA For Laravel.

1.8k8.5M33](/packages/anhskohbo-no-captcha)[albertcht/invisible-recaptcha

Invisible reCAPTCHA For Laravel.

6031.6M6](/packages/albertcht-invisible-recaptcha)

PHPackages © 2026

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