PHPackages                             switon/captcha - 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. [Image &amp; Media](/categories/media)
4. /
5. switon/captcha

ActiveLibrary[Image &amp; Media](/categories/media)

switon/captcha
==============

CAPTCHA generation and verification for Switon Framework

v1.0.0(1mo ago)00MITPHPPHP &gt;=8.3CI passing

Since May 10Pushed 2d agoCompare

[ Source](https://github.com/switon-php/captcha)[ Packagist](https://packagist.org/packages/switon/captcha)[ Docs](https://github.com/switon-php/captcha)[ RSS](/packages/switon-captcha/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

Switon Captcha Package
======================

[](#switon-captcha-package)

[![CI](https://camo.githubusercontent.com/06e0fb70a6432b335252c9c30c65a817dc8c43c4402be7a405beca227be956c3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f737769746f6e2d7068702f636170746368612f63692e796d6c3f6272616e63683d6d61696e266c6162656c3d4349)](https://github.com/switon-php/captcha/actions/workflows/ci.yml) [![PHP 8.3+](https://camo.githubusercontent.com/c03f51341eebaefabbf137e291b20523fc74b4ffd084406d88524d266d95085d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332532422d373737424234)](https://www.php.net/)

Switon's CAPTCHA challenge, proof, and action-guard layer.

Highlights
----------

[](#highlights)

- **Challenge and verification flow:** generate a CAPTCHA, then verify the returned proof.
- **Standard request fields:** `CaptchaProofResolver` reads the usual CAPTCHA key and code fields.
- **Protected actions:** `#[CaptchaRequired]` blocks an action until proof is valid.
- **Image backends:** the package includes GD and Imagick adapters for image generation.
- **Observable checks:** creation, verification, and failure activity can be observed.

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

[](#installation)

```
composer require switon/captcha
```

Quick Start
-----------

[](#quick-start)

```
use Switon\Captcha\CaptchaInterface;
use Switon\Captcha\Attribute\CaptchaRequired;
use Switon\Captcha\CaptchaProof;
use Switon\Core\Attribute\Autowired;

class LoginController
{
    #[Autowired] protected CaptchaInterface $captcha;

    public function getCaptcha(): array
    {
        return $this->captcha->create();
    }

    public function verifyAction(CaptchaProof $proof): void
    {
        $this->captcha->verify($proof);
    }

    #[CaptchaRequired]
    public function submitAction(): void
    {
    }
}
```

Docs:

License
-------

[](#license)

MIT.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance97

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

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

Unknown

Total

1

Last Release

30d ago

### Community

Maintainers

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

---

Top Contributors

[![switon-php](https://avatars.githubusercontent.com/u/247358032?v=4)](https://github.com/switon-php "switon-php (1 commits)")

---

Tags

captchaimagesecurityswtionverificationsecurityimagecaptchaverificationswiton

### Embed Badge

![Health badge](/badges/switon-captcha/health.svg)

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

###  Alternatives

[intervention/image

PHP Image Processing

14.8k203.8M2.5k](/packages/intervention-image)[league/glide

Wonderfully easy on-demand image manipulation library with an HTTP based API.

2.8k52.6M137](/packages/league-glide)[liip/imagine-bundle

This bundle provides an image manipulation abstraction toolkit for Symfony-based projects.

1.7k39.4M236](/packages/liip-imagine-bundle)[spatie/image

Manipulate images with an expressive API

1.4k58.5M175](/packages/spatie-image)[intervention/image-laravel

Laravel Integration of Intervention Image

1558.1M158](/packages/intervention-image-laravel)[intervention/gif

PHP GIF Encoder/Decoder

6025.4M14](/packages/intervention-gif)

PHPackages © 2026

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