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

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

xetaio/recaptcha
================

reCAPTCHA Validator for Laravel 5

4.0.0(5y ago)05.3kMITPHPPHP ^7.2.5

Since Apr 27Pushed 5y agoCompare

[ Source](https://github.com/XetaIO/recaptcha)[ Packagist](https://packagist.org/packages/xetaio/recaptcha)[ Docs](http://github.com/greggilbert/recaptcha)[ RSS](/packages/xetaio-recaptcha/feed)WikiDiscussions master Synced today

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

A reCAPTCHA Validator for Laravel

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

[](#installation)

```
composer require xetaio/recaptcha
```

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

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~120 days

Recently: every ~418 days

Total

23

Last Release

2108d ago

Major Versions

1.1.5 → 2.0.02015-02-08

2.2.0 → 3.0.02019-10-26

3.0.0 → 4.0.02020-08-02

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

3.0.0PHP &gt;=7.2

4.0.0PHP ^7.2.5

### Community

Maintainers

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

---

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)")[![Xety](https://avatars.githubusercontent.com/u/8210023?v=4)](https://github.com/Xety "Xety (4 commits)")[![peterpan666](https://avatars.githubusercontent.com/u/4153168?v=4)](https://github.com/peterpan666 "peterpan666 (2 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)")[![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)")[![simondubois](https://avatars.githubusercontent.com/u/9416595?v=4)](https://github.com/simondubois "simondubois (1 commits)")[![JN-Jones](https://avatars.githubusercontent.com/u/1917879?v=4)](https://github.com/JN-Jones "JN-Jones (1 commits)")[![dereknutile](https://avatars.githubusercontent.com/u/146833?v=4)](https://github.com/dereknutile "dereknutile (1 commits)")[![devinfd](https://avatars.githubusercontent.com/u/468399?v=4)](https://github.com/devinfd "devinfd (1 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)")

---

Tags

laravelrecaptchacaptchalaravel5

### Embed Badge

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

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