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

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

inkvizytor/recaptcha
====================

reCAPTCHA Validator for Laravel 5, 6, 7, 8, 9

2.2.3(4y ago)03.3k↓50%1MITPHPPHP &gt;=5.3.0

Since Apr 27Pushed 4y agoCompare

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

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

Abandoned
=========

[](#abandoned)

All good things must come to an end. The sad fact is that I don't have time to maintain this package, so the release of Laravel 6 is as good as any to make a clean break. You should take a look at the forks to see if anyone is carrying on the torch.

Thanks to everyone for sticking by this package for years!

Recaptcha
=========

[](#recaptcha)

A reCAPTCHA Validator for Laravel 5.

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

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

[](#installation)

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

```
{
    "require": {
        "greggilbert/recaptcha": "dev-master"
    }
}
```

Setup
-----

[](#setup)

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

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

```

and the following to `aliases`:

```
'Recaptcha' => Greggilbert\Recaptcha\Facades\Recaptcha::class,

```

2. Run `php artisan vendor:publish --provider="Greggilbert\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 1.
- If you are upgrading to v2 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.',
```

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' ]);
```

### 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

Popularity20

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 67.3% 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 ~554 days

Total

24

Last Release

1517d ago

Major Versions

1.1.5 → 2.0.02015-02-08

### Community

Maintainers

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

---

Top Contributors

[![greggilbert](https://avatars.githubusercontent.com/u/169482?v=4)](https://github.com/greggilbert "greggilbert (74 commits)")[![theothertomelliott](https://avatars.githubusercontent.com/u/1131428?v=4)](https://github.com/theothertomelliott "theothertomelliott (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)")[![elfif](https://avatars.githubusercontent.com/u/1546817?v=4)](https://github.com/elfif "elfif (1 commits)")[![Gawdl3y](https://avatars.githubusercontent.com/u/279900?v=4)](https://github.com/Gawdl3y "Gawdl3y (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)")[![adrian1207](https://avatars.githubusercontent.com/u/9296448?v=4)](https://github.com/adrian1207 "adrian1207 (1 commits)")[![JN-Jones](https://avatars.githubusercontent.com/u/1917879?v=4)](https://github.com/JN-Jones "JN-Jones (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)")[![simondubois](https://avatars.githubusercontent.com/u/9416595?v=4)](https://github.com/simondubois "simondubois (1 commits)")[![smok55453](https://avatars.githubusercontent.com/u/37620534?v=4)](https://github.com/smok55453 "smok55453 (1 commits)")[![inkvizytor](https://avatars.githubusercontent.com/u/10927355?v=4)](https://github.com/inkvizytor "inkvizytor (1 commits)")[![ChrisReid](https://avatars.githubusercontent.com/u/2385373?v=4)](https://github.com/ChrisReid "ChrisReid (1 commits)")[![dereknutile](https://avatars.githubusercontent.com/u/146833?v=4)](https://github.com/dereknutile "dereknutile (1 commits)")

---

Tags

laravelrecaptchacaptchalaravel5

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/inkvizytor-recaptcha/health.svg)](https://phpackages.com/packages/inkvizytor-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)
