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

ActiveLibrary[Security](/categories/security)

daycry/recaptcha
================

Recaptcha library for CodeIgniter 4

v1.0.0(4y ago)2451MITPHPPHP ^7.3 || ^8.0

Since Mar 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/daycry/recaptcha)[ Packagist](https://packagist.org/packages/daycry/recaptcha)[ Docs](https://github.com/daycry/recaptcha)[ RSS](/packages/daycry-recaptcha/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (9)Versions (3)Used By (0)

[![Donate](https://camo.githubusercontent.com/604e3db9c8751116b3f765aad0353ec7ded655bbe8aaacbc38d8c4a6b784b3ed/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d677265656e2e737667)](https://www.paypal.com/donate?business=SYC5XDT23UZ5G&no_recurring=0&item_name=Thank+you%21&currency_code=EUR)

Recaptcha Library [![](https://github.com/daycry/encryption/workflows/PHP%20Tests/badge.svg)](https://github.com/daycry/encryption/actions?query=workflow%3A%22PHP+Tests%22)
============================================================================================================================================================================

[](#recaptcha-library-)

ReCaptcha for Codeigniter 4

Installation via composer
-------------------------

[](#installation-via-composer)

Use the package with composer install

```
> composer require daycry/recaptcha

```

Manual installation
-------------------

[](#manual-installation)

Download this repo and then enable it by editing **app/Config/Autoload.php** and adding the **Daycry\\ReCaptcha**namespace to the **$psr4** array. For example, if you copied it into **app/ThirdParty**:

```
$psr4 = [
    'Config'      => APPPATH . 'Config',
    APP_NAMESPACE => APPPATH,
    'App'         => APPPATH,
    'Daycry\ReCaptcha' => APPPATH .'ThirdParty/recaptcha/src',
];
```

Setup
-----

[](#setup)

Run command:

```
> php spark recaptcha:publish

```

This command will copy a config file to your app namespace.

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

[](#configuration)

In the .env file you need to add your personal ReCaptcha keys.

```
# --------------------------------------------------------------------
# ReCaptcha 2
# --------------------------------------------------------------------
recaptcha2.key = 'XXXXXXXX-XXXXXXXX'
recaptcha2.secret = 'XXXXXXXX-XXXXXXXX'

# --------------------------------------------------------------------
# ReCaptcha 3
# --------------------------------------------------------------------
recaptcha3.key = 'XXXXXXXX-XXXXXXXX'
recaptcha3.secret = 'XXXXXXXX-XXXXXXXX'
recaptcha3.scoreThreshold = 0.5

```

In the /app/Config/Validation.php file you need to add settings for validator:

```
public $ruleSets = [
    ...
    \Daycry\ReCaptcha\Validation\ReCaptchaRules::class
];
```

### Rendering ReCaptcha v2

[](#rendering-recaptcha-v2)

```
helper(['form', 'reCaptcha']);

echo form_open();

echo reCaptcha2('reCaptcha2', ['id' => 'recaptcha_v2'], ['theme' => 'dark']);

echo form_submit('submit', 'Submit');

echo form_close();
```

### Rendering ReCaptcha v3

[](#rendering-recaptcha-v3)

```
helper(['form', 'reCaptcha']);

echo form_open();

echo reCaptcha3('reCaptcha3', ['id' => 'recaptcha_v3'], ['action' => 'contactForm']);

echo form_submit('submit', 'Submit');

echo form_close();
```

If you are using Twig:

add helper in array of helpers in the controller

```
helper(['form', 'reCaptcha']);
```

add **'reCaptcha3'** in **functions\_safe** in config file and call the helper funcion.

```
public $functions_safe = [ 'form_hidden', 'form_open', 'form_close', 'csrf_token', 'csrf_hash', 'url_title', 'reCaptcha3' ];
```

and call the function in twig file.

```
{{ reCaptcha3( 'reCaptcha', {'id' : 'recaptcha_v3'}, {'action' : 'signup'} ) | raw }}
```

### Checking ReCaptcha in a model:

[](#checking-recaptcha-in-a-model)

```
public $validationRules = [
    'reCaptcha2' => 'required|reCaptcha2[]'
    'reCaptcha3' => 'required|reCaptcha3[contactForm,0.9]'
    ....
];
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

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

Unknown

Total

1

Last Release

1585d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b0f66565d5c9ca3c84fb294e04f8d5e0b9a867d9c06f83b95bf168bd6fcf9bc?d=identicon)[daycry](/maintainers/daycry)

---

Top Contributors

[![daycry](https://avatars.githubusercontent.com/u/7590335?v=4)](https://github.com/daycry "daycry (7 commits)")

---

Tags

configcodeigniterrecaptchacodeigniter4

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[phpdevsr/recaptcha-codeigniter4

Free to Use Library reCAPTCHA v2 for Codeigniter 4

102.1k](/packages/phpdevsr-recaptcha-codeigniter4)[phelium/recaptcha

reCAPTCHA v2 class

4393.2k](/packages/phelium-recaptcha)[cakephp-fr/recaptcha

To easily use Google Recaptcha (free CAPTCHA service that protect websites from spam and abuse) in CakePHP projects

1419.5k](/packages/cakephp-fr-recaptcha)

PHPackages © 2026

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