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

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

zhh2100/pidan-captcha
=====================

captcha package for pidan 同步到v3.0.8 Oct 26, 2022

v1.0.9(3y ago)017Apache-2.0PHP

Since Mar 15Pushed 3y ago1 watchersCompare

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

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

pidan-captcha
=============

[](#pidan-captcha)

pidanphp6 验证码类库

安装
--

[](#安装)

> composer require pidan/pidan-captcha

使用
--

[](#使用)

### 在控制器中输出验证码

[](#在控制器中输出验证码)

在控制器的操作方法中使用

```
public function captcha($id = '')
{
	return captcha($id);
}

```

然后注册对应的路由来输出验证码

### 模板里输出验证码

[](#模板里输出验证码)

首先要在你应用的路由定义文件中，注册一个验证码路由规则。

```
\pidan\facade\Route::get('captcha/[:id]', "\\pidan\\captcha\\CaptchaController@index");

```

然后就可以在模板文件中使用

```
{:captcha_img()}

```

或者

```

```

> 上面两种的最终效果是一样的

### 控制器里验证

[](#控制器里验证)

使用TP的内置验证功能即可

```
$this->validate($data,[
    'captcha|验证码'=>'require|captcha'
]);

```

或者手动验证

```
if(!captcha_check($captcha)){
 //验证失败
};

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

8

Last Release

1129d ago

### Community

Maintainers

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

---

Top Contributors

[![zhh2100](https://avatars.githubusercontent.com/u/10617010?v=4)](https://github.com/zhh2100 "zhh2100 (8 commits)")

### Embed Badge

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

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