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

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

osmaviation/recaptcha
=====================

reCAPTCHA Validator for Laravel 5

2.3.4(5y ago)06.2kMITPHPPHP &gt;=7.3

Since Apr 27Pushed 5y agoCompare

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

READMEChangelog (5)Dependencies (1)Versions (28)Used By (0)

Recaptcha
=========

[](#recaptcha)

A reCAPTCHA Validator for Laravel 5.8 and up.

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

[](#installation)

Install the package via `composer require osmaviation/recaptcha`

Setup
-----

[](#setup)

If you have auto-discovery enabled the package will register itself.

1. If you need to change the default config you can publish it with `php artisan vendor:publish --provider="Greggilbert\Recaptcha\RecaptchaServiceProvider"`.
2. In your `.env` file, set up your credentials.

- `RECAPTCHA_PUBLIC_KEY` for your public key.
- `RECAPTCHA_PRIVATE_KEY` for your private key.
- If you are not using the most recent version of reCAPTCHA, set `RECAPTCHA_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).

1. 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 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 63.2% 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 ~108 days

Recently: every ~70 days

Total

26

Last Release

2003d ago

Major Versions

1.1.5 → 2.0.02015-02-08

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

2.3.1PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/16b2089f55ff5ab3154ef21caec78446d23b1515cc074d2d1c2bf184a9e64603?d=identicon)[tormjens](/maintainers/tormjens)

---

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)")[![tormjens](https://avatars.githubusercontent.com/u/3974889?v=4)](https://github.com/tormjens "tormjens (6 commits)")[![hiddeco](https://avatars.githubusercontent.com/u/10063039?v=4)](https://github.com/hiddeco "hiddeco (4 commits)")[![alex-p-ysbm](https://avatars.githubusercontent.com/u/32099333?v=4)](https://github.com/alex-p-ysbm "alex-p-ysbm (3 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)")[![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)")[![devinfd](https://avatars.githubusercontent.com/u/468399?v=4)](https://github.com/devinfd "devinfd (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)")[![serhii-h-ysbm](https://avatars.githubusercontent.com/u/28148638?v=4)](https://github.com/serhii-h-ysbm "serhii-h-ysbm (1 commits)")[![simondubois](https://avatars.githubusercontent.com/u/9416595?v=4)](https://github.com/simondubois "simondubois (1 commits)")[![dereknutile](https://avatars.githubusercontent.com/u/146833?v=4)](https://github.com/dereknutile "dereknutile (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/osmaviation-recaptcha/health.svg)

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

###  Alternatives

[anhskohbo/no-captcha

No CAPTCHA reCAPTCHA For Laravel.

1.8k8.3M28](/packages/anhskohbo-no-captcha)

PHPackages © 2026

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