PHPackages                             cccyun/think-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cccyun/think-captcha

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cccyun/think-captcha
====================

captcha package for thinkphp

3.0.12(1w ago)41.3k↓71.4%4Apache-2.0PHP

Since Jun 2Pushed 1w agoCompare

[ Source](https://github.com/netcccyun/think-captcha)[ Packagist](https://packagist.org/packages/cccyun/think-captcha)[ RSS](/packages/cccyun-think-captcha/feed)WikiDiscussions 3.0 Synced yesterday

READMEChangelog (5)Dependencies (2)Versions (7)Used By (0)

think-captcha
=============

[](#think-captcha)

thinkphp 验证码类库（精简版）

安装
--

[](#安装)

> composer require cccyun/think-captcha

使用
--

[](#使用)

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

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

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

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

```

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

### 模板里输出验证码

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

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

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

```

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

```
{:captcha_img()}

```

或者

```

```

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

### 控制器里验证

[](#控制器里验证)

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

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

```

或者手动验证

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

```

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance98

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.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 ~186 days

Recently: every ~249 days

Total

7

Last Release

10d ago

Major Versions

2.0.x-dev → 3.0.102024-10-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b3d6d144e77e72a96257be62619e642335ccbc448b13bb0e88d13c3db42c6c8?d=identicon)[cccyun](/maintainers/cccyun)

---

Top Contributors

[![liu21st](https://avatars.githubusercontent.com/u/1111670?v=4)](https://github.com/liu21st "liu21st (30 commits)")[![yunwuxin](https://avatars.githubusercontent.com/u/2168125?v=4)](https://github.com/yunwuxin "yunwuxin (14 commits)")[![netcccyun](https://avatars.githubusercontent.com/u/8541489?v=4)](https://github.com/netcccyun "netcccyun (3 commits)")[![ZayneSW](https://avatars.githubusercontent.com/u/16889839?v=4)](https://github.com/ZayneSW "ZayneSW (3 commits)")[![normal-coder](https://avatars.githubusercontent.com/u/6902432?v=4)](https://github.com/normal-coder "normal-coder (3 commits)")[![zhaishuaigan](https://avatars.githubusercontent.com/u/6310602?v=4)](https://github.com/zhaishuaigan "zhaishuaigan (1 commits)")[![lait233](https://avatars.githubusercontent.com/u/31282366?v=4)](https://github.com/lait233 "lait233 (1 commits)")[![tianheng2017](https://avatars.githubusercontent.com/u/29515610?v=4)](https://github.com/tianheng2017 "tianheng2017 (1 commits)")[![wmwlwmwl](https://avatars.githubusercontent.com/u/168271477?v=4)](https://github.com/wmwlwmwl "wmwlwmwl (1 commits)")[![anydson](https://avatars.githubusercontent.com/u/15711052?v=4)](https://github.com/anydson "anydson (1 commits)")

### Embed Badge

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

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

###  Alternatives

[topthink/think-captcha

captcha package for thinkphp

117970.1k74](/packages/topthink-think-captcha)[topthink/think-worker

workerman extend for thinkphp

216235.9k9](/packages/topthink-think-worker)[yunwuxin/think-cron

计划任务

17317.4k](/packages/yunwuxin-think-cron)[liliuwei/thinkphp-jump

适用于thinkphp6.0+的跳转扩展

2876.7k1](/packages/liliuwei-thinkphp-jump)[zzstudio/think-addons

The ThinkPHP6 Addons Package

1578.7k](/packages/zzstudio-think-addons)[topthink/think-annotation

Annotation For ThinkPHP

4833.6k8](/packages/topthink-think-annotation)

PHPackages © 2026

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