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

ActiveLibrary

enjoys/forms-recaptcha
======================

Addon for enjoys/forms

3.0.0(3y ago)01.6kMITPHPPHP ^8.0

Since Apr 29Pushed 3y ago1 watchersCompare

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

READMEChangelogDependencies (8)Versions (16)Used By (0)

forms-recaptcha
===============

[](#forms-recaptcha)

addon for enjoys/forms

Run built-in server for view example
------------------------------------

[](#run-built-in-server-for-view-example)

```
php -S localhost:8000 -t ./example .route
```

### Usage

[](#usage)

```
// ...before code
// Optional. Set ID for form (for V2Invisible and V3)
$form->setAttribute(AttributeFactory::create('id', uniqid()));
// Init reCaptcha
$captcha = new reCaptcha($Psr18_HttpClient, $Psr7RequestFactory, $Psr7StreamFactory);

$captcha->setOptions([
    'type' => V3::class, //V2Invisible, V2, V3
    'publicKey' => '...',
    'privateKey' => '...',
    'submitEl' => 'submit1',
    // more options ...
]);

$form->captcha($captcha);
$form->submit('submit1');
// more code...
```

### Global options

[](#global-options)

- **privateKey** `string` `required` privateKey
- **publicKey** `string` `required` publicKey
- **language** `string` Language `default: en`
- **type** `string` Type `default: \Enjoys\Forms\Captcha\reCaptcha\Type\V2`

reCAPTCHA v2
============

[](#recaptcha-v2)

*widgets options*

- **data-theme** `string` `dark|light` Optional. The color theme of the widget. `default: light`
- **data-size** `string` `compact|normal` Optional. The size of the widget. `default: normal`
- **data-tabindex** `string` Optional. The tabindex of the widget and challenge. If other elements in your page use tabindex, it should be set to make user navigation easier. `default: null`
- **data-callback** `string` Optional. The name of your callback function, executed when the user submits a successful response. The g-recaptcha-response token is passed to your callback. `default: null`
- **data-expired-callback** `string` Optional. The name of your callback function, executed when the reCAPTCHA response expires and the user needs to re-verify. `default: null`
- **data-error-callback** `string` Optional. The name of your callback function, executed when reCAPTCHA encounters an error (usually network connectivity) and cannot continue until connectivity is restored. If you specify a function here, you are responsible for informing the user that they should retry. `default: null`

Invisible reCAPTCHA &amp; reCAPTCHA v3
======================================

[](#invisible-recaptcha--recaptcha-v3)

*general options*

- **submitEl** `string` The element submit name. Also, the submit button ID should not be `submit`
- **The form must have an ID attribute.**
- **type** `\Enjoys\Forms\Captcha\reCaptcha\Type\V2Invisible or V2Invisible::class` for Invisible reCAPTCHCA, `\Enjoys\Forms\Captcha\reCaptcha\Type\V3  or V3::class` for reCAPTCHA v3

*widgets options*

- **data-badge** `string` `bottomright|bottomleft|inline` Optional. Reposition the reCAPTCHA badge. 'inline' lets you position it with CSS. `default: bottomright`
- **data-size** `string` `invisible` Optional. Used to create an invisible widget bound to a div and programmatically executed. `default: null`
- **data-tabindex** `string` Optional. The tabindex of the widget and challenge. If other elements in your page use tabindex, it should be set to make user navigation easier. `default: null`
- **data-callback** `string` Optional. The name of your callback function, executed when the user submits a successful response. The g-recaptcha-response token is passed to your callback. `default: null`
- **data-expired-callback** `string` Optional. The name of your callback function, executed when the reCAPTCHA response expires and the user needs to re-verify. `default: null`
- **data-error-callback** `string` Optional. The name of your callback function, executed when reCAPTCHA encounters an error (usually network connectivity) and cannot continue until connectivity is restored. If you specify a function here, you are responsible for informing the user that they should retry. `default: null`

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Recently: every ~0 days

Total

15

Last Release

1099d ago

Major Versions

1.2.0 → 2.0.02022-05-02

2.x-dev → 3.0.02023-05-13

PHP version history (2 changes)1.0.0PHP &gt;= 8.0

2.0.1PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25447823?v=4)[enjoys](/maintainers/enjoys)[@enjoys](https://github.com/enjoys)

---

Top Contributors

[![Enjoyzz](https://avatars.githubusercontent.com/u/1448659?v=4)](https://github.com/Enjoyzz "Enjoyzz (28 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k18.5M1.6k](/packages/cakephp-cakephp)[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[aporat/store-receipt-validator

PHP receipt validator for Apple App Store and Amazon Appstore

6503.9M9](/packages/aporat-store-receipt-validator)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M65](/packages/opensearch-project-opensearch-php)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M343](/packages/drupal-core-recommended)[kbsali/redmine-api

Redmine API client

4221.1M24](/packages/kbsali-redmine-api)

PHPackages © 2026

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