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

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

exinfinite/captcha
==================

php captcha

1.0.0(5y ago)04MITPHPPHP ~5.6.0

Since Mar 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/exinfinite/captcha)[ Packagist](https://packagist.org/packages/exinfinite/captcha)[ RSS](/packages/exinfinite-captcha/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

驗證碼使用
=====

[](#驗證碼使用)

安裝
--

[](#安裝)

```
composer require exinfinite/captcha
```

使用
--

[](#使用)

### 產生驗證碼

[](#產生驗證碼)

```
use Exinfinite\Captcha\Builder;
$captcha = new Builder();

//使用預設值產生
$captcha->build();

//自訂參數
$captcha->setSize(150, 45)
        ->setLine(6)
        ->setPixel(180)
        ->build();
```

> [![](https://github.com/exinfinite/captcha/raw/main/sample/1.png)](https://github.com/exinfinite/captcha/blob/main/sample/1.png)[![](https://github.com/exinfinite/captcha/raw/main/sample/2.png)](https://github.com/exinfinite/captcha/blob/main/sample/2.png)[![](https://github.com/exinfinite/captcha/raw/main/sample/3.png)](https://github.com/exinfinite/captcha/blob/main/sample/3.png)

### 比對使用者輸入驗證碼是否正確

[](#比對使用者輸入驗證碼是否正確)

```
$is_valid = $captcha->verify("使用者輸入內容");//Case-insensitive
$is_valid = $captcha->verify("使用者輸入內容", true);//Case-sensitive

if($is_valid === true){
    ...
}
```

### 取得產出的驗證碼內容

[](#取得產出的驗證碼內容)

```
$captcha->getTxt();
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

1888d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19932513?v=4)[exinfinite](/maintainers/exinfinite)[@exinfinite](https://github.com/exinfinite)

---

Top Contributors

[![exinfinite](https://avatars.githubusercontent.com/u/19932513?v=4)](https://github.com/exinfinite "exinfinite (5 commits)")

### Embed Badge

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

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