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

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

ruiorz/captcha
==============

Captcha library for PHP

v1.0.3(1y ago)12431MITPHPPHP &gt;=8.1

Since Jan 30Pushed 1y ago1 watchersCompare

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

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

Captcha library for PHP
=======================

[](#captcha-library-for-php)

A simple captcha library for PHP

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

[](#installation)

Require this package with composer:

```
composer require ruiorz/captcha
```

Usage
-----

[](#usage)

```
# click captcha:
$captcha = new \Ruiorz\Captcha\Click\ClickCaptcha();
$result = $captcha->draw();

# or math captcha:
$captcha = new \Ruiorz\Captcha\Math\MathCaptcha();
$result = $captcha->draw();

# result:
print_r($result->getCaptchaData())
print_r($result->getImageByte())
print_r($result->getImageBase64())
```

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

[](#configuration)

```
# click captcha:
$config = new \Ruiorz\Captcha\Click\ClickCaptchaConfig();
$config->setFontPath('src/Click/fonts/msyh.ttc');
$config->setImagePath('src/Click/images/3.jpg');
$config->setVerifyLength(3);
$result = (new \Ruiorz\Captcha\Click\ClickCaptcha($config))->draw();
print_r($result->getCaptchaData());

# or math captcha:
$config = new \Ruiorz\Captcha\Math\MathCaptchaConfig();
$config->setFontPath('src/Math/fonts/Bitsumishi.ttf');
$result = (new \Ruiorz\Captcha\Math\MathCaptcha($config))->draw();
print_r($result->getCaptchaData());
```

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~51 days

Total

4

Last Release

677d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/09f4260afd38e3ec44a29d1f487b2f24c66fc72e12e2cab6956f6b2a273f0fa6?d=identicon)[ruiorz](/maintainers/ruiorz)

---

Top Contributors

[![ruiorz](https://avatars.githubusercontent.com/u/5675132?v=4)](https://github.com/ruiorz "ruiorz (6 commits)")[![cokeyAdmin](https://avatars.githubusercontent.com/u/37037515?v=4)](https://github.com/cokeyAdmin "cokeyAdmin (3 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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