PHPackages                             easedevs/yii2-turnstile-validator - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. easedevs/yii2-turnstile-validator

ActiveYii2-extension[Validation &amp; Sanitization](/categories/validation)

easedevs/yii2-turnstile-validator
=================================

Yii2 validator for Cloudflare's Turnstile CAPTCHA alternative

v1.0.2(2y ago)57.0k—0%GPL-3.0-or-laterPHP

Since Nov 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/EaseDevs/yii2-turnstile-validator)[ Packagist](https://packagist.org/packages/easedevs/yii2-turnstile-validator)[ RSS](/packages/easedevs-yii2-turnstile-validator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

yii2-turnstile-validator
========================

[](#yii2-turnstile-validator)

Yii2 validator for Cloudflare's Turnstile CAPTCHA alternative

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ php composer.phar require "easedevs/yii2-turnstile-validator" "*"
```

or add

```
"easedevs/yii2-turnstile-validator": "*"

```

to the `require` section of your `composer.json` file.

In your config, add a component configuration:

```
    'turnstile' => [
        'class' => 'easedevs\yii2\turnstile\TurnstileConfig',
        'siteKey' => '_YOUR_SITE_KEY_FROM_CLOUDFLARE_TURNSTILE_',
        'secret' => '_YOUR_SECRET_FROM_CLOUDFLARE_TURNSTILE_',
    ],
```

Usage
-----

[](#usage)

Using as an `ActiveField` widget:

```
use easedevs\yii2\turnstile\TurnstileInput;

echo $form->field($model, 'captcha')->widget(TurnstileInput::class, [
    'size' => TurnstileInput::SIZE_COMPACT,
]);
```

Using as a simple widget:

```
use easedevs\yii2\turnstile\TurnstileInput;

echo TurnstileInput::widget([
    'name' => 'captcha',
    'size' => TurnstileInput::SIZE_COMPACT,
]);
```

Using validator in a model for verification of the result on the server:

```
use easedevs\yii2\turnstile\TurnstileInputValidator;

class Account extends Model
{
    public $captcha;

    public function rules()
    {
        return [
            [['captcha'], 'string'],
            [['captcha'], TurnstileInputValidator::class],
        ];
    }
}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Total

3

Last Release

909d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5036176?v=4)[Steven Michaels](/maintainers/smichae)[@smichae](https://github.com/smichae)

---

Top Contributors

[![smichae](https://avatars.githubusercontent.com/u/5036176?v=4)](https://github.com/smichae "smichae (6 commits)")

---

Tags

validatorcaptchayii2cloudflarewidgetturnstile

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/easedevs-yii2-turnstile-validator/health.svg)

```
[![Health](https://phpackages.com/badges/easedevs-yii2-turnstile-validator/health.svg)](https://phpackages.com/packages/easedevs-yii2-turnstile-validator)
```

###  Alternatives

[codeonyii/yii2-at-least-validator

Validates at least one (or more) attributes.

28253.5k1](/packages/codeonyii-yii2-at-least-validator)[arogachev/yii2-many-to-many

Many-to-many ActiveRecord relation for Yii 2 framework

3541.2k4](/packages/arogachev-yii2-many-to-many)

PHPackages © 2026

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