PHPackages                             fruitcakestudio/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. [Security](/categories/security)
4. /
5. fruitcakestudio/recaptcha

ActiveLibrary[Security](/categories/security)

fruitcakestudio/recaptcha
=========================

reCAPTCHA library

v0.3.1(9y ago)1625.5k31MITPHP

Since Dec 4Pushed 8y ago6 watchersCompare

[ Source](https://github.com/fruitcake/php-recaptcha)[ Packagist](https://packagist.org/packages/fruitcakestudio/recaptcha)[ RSS](/packages/fruitcakestudio-recaptcha/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (7)Used By (1)

reCAPTCHA Library
-----------------

[](#recaptcha-library)

This is a package to implement reCAPTCHA ()

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

[](#installation)

Require this package with composer:

```
composer require fruitcakestudio/recaptcha

```

Configuration
-------------

[](#configuration)

You can create a new instance by passing the SiteKey and Secret from your API. You can get that at

```
use FruitcakeStudio\ReCaptcha\ReCaptcha;

$captcha = new ReCaptcha($siteKey, $secret, 'en');
```

Widget usage
------------

[](#widget-usage)

To show the reCAPTCHA on a form, use the class to render the script tag and the widget.

```

```

See  for more options.

Verifying a response
--------------------

[](#verifying-a-response)

After the post, use the class to verify the response. You get true or false back. You can access the error codes with $captcha-&gt;getErrors() as array, or get a readable message:

```
if ($captcha->verify($_POST["g-recaptcha-response"], $_SERVER["REMOTE_ADDR"])) {
    echo "OK!";
} else {
    echo "FAILED! " . $captcha->getErrorMessage();
}
```

> Note: An error message is not always present.

You can also let the class discover the POST response and remote IP by using verifyGlobals();

```
if ($captcha->verifyGlobals()) {
    echo "OK!";
}
```

If you are using Symfony HttpFoundation, you can use the Request object instead of the globals.

```
if ($captcha->verifyRequest($request)) {
    echo "OK!";
}

// Or by setting the request before
$captcha->setRequest($request);
if ($captcha->verifyRequest()) {
    echo "OK!";
}
```

See the docs on

Laravel integration
-------------------

[](#laravel-integration)

Since 0.3.x, Laravel integration is supported with a standalone package:

The classes are the same, only the configuration package name is 'laravel-recaptcha' instead of 'recaptcha'.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

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

Recently: every ~213 days

Total

6

Last Release

3321d ago

### Community

Maintainers

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

---

Top Contributors

[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (18 commits)")

---

Tags

recaptchaspamcaptchanocaptchano-captcha

### Embed Badge

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

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

###  Alternatives

[gregwar/captcha

Captcha generator

1.8k9.6M136](/packages/gregwar-captcha)[karser/karser-recaptcha3-bundle

Google ReCAPTCHA v3 for Symfony

1862.4M7](/packages/karser-karser-recaptcha3-bundle)[gregwar/captcha-bundle

Captcha bundle

3524.7M32](/packages/gregwar-captcha-bundle)[usarise/turnstile

PHP library for Turnstile, is Cloudflare’s smart CAPTCHA alternative. It can be embedded into any website without sending traffic through Cloudflare and works without showing visitors a CAPTCHA.

2393.5k6](/packages/usarise-turnstile)

PHPackages © 2026

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