PHPackages                             egment/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. egment/captcha

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

egment/captcha
==============

A captcha package for separation web system.

v0.3.1(6y ago)0731MITPHP

Since Feb 2Pushed 6y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (18)Used By (0)

egment/captcha
==============

[](#egmentcaptcha)

### Quick Start

[](#quick-start)

- The simplest way to use it

```
use Egment/captcha;

$path = (new captcha)->create();
//Above return value looks like this:
[
    'master_path' => 'foo.jpg',
    'part_path' => 'bar.jpg'
]

//also we can specified a type parameter to add base64 code value.
(new captcha)->store(1);
//This return value will be looks like this:
[
    'master_path' => 'foo.jpg',
    'part_path' => 'bar.jpg',
    'master_base64' => 'MASTER_WHAT_BASE64CODE_LOOKSLIKE',
    'part_base64' => 'MASTER_WHAT_BASE64CODE_LOOKSLIKE',
]
```

- You can also get base64encode image without store it through this code:

```
    $captcha = new SlideCaptcha();
    $result = $captcha->get();
```

Above code will only return base64code: \[ 'master\_base64' =&gt; 'MASTER\_WHAT\_BASE64CODE\_LOOKSLIKE', 'part\_base64' =&gt; 'MASTER\_WHAT\_BASE64CODE\_LOOKSLIKE', \]

- Use configure options

```
use Egment/captcha
$options = [
    'store_path' => './', //captcha image store path
    'bg_path' => './',	//background pictures that egment/captcha will use
    'master_name' => 'foo' . time(),
    'part_name' => 'bar' . time(),
    'part_size' => 30, //part captcha size
    'bg_exts' => ['jpg','jpeg','png'] //allowed background pictures extensions

]
$captcha = new Capthca($options)
$result = $captcha->create();
```

- Use auth method to authenticate input parameters.

```
$captcha->auth($positionParameters, function ($params, $instance) {
    return $instance->authSlidePosition($params['position'], $instance->getPartMiddlePoint()[0]);
});
```

- Use getPartPoints method to get part points

```
 $arr = $captcha->getPartPoints()
```

- Use getWidth and getHeight to get part properties

```
 $width = $captcha->getPartWidth()
 $height = $captcha->getPartHeight()
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

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

Every ~3 days

Total

16

Last Release

2244d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a45203aeb9fdf7aec6f693ccf3d6bf0926f377f5748433b908330ad36c510d8?d=identicon)[egment](/maintainers/egment)

---

Top Contributors

[![zayn11mar](https://avatars.githubusercontent.com/u/31030510?v=4)](https://github.com/zayn11mar "zayn11mar (2 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/egment-captcha/health.svg)](https://phpackages.com/packages/egment-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)
