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

ActiveThink-extend[Utility &amp; Helpers](/categories/utility)

hectorqin/think-captcha
=======================

Captcha package for ThinkPHP5 and ThinkPHP6

v1.0.0(6y ago)110Apache-2.0PHP

Since Nov 6Pushed 6y ago1 watchersCompare

[ Source](https://github.com/hectorqin/think-captcha)[ Packagist](https://packagist.org/packages/hectorqin/think-captcha)[ RSS](/packages/hectorqin-think-captcha/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

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

[](#think-captcha)

验证码类库 For ThinkPHP5.1 和 ThinkPHP6.0 基于[top-think/think-captcha](https://github.com/top-think/think-captcha) 修改而来

安装
--

[](#安装)

```
composer require hectorqin/think-captcha
```

配置
--

[](#配置)

修改 config/captcha.php 配置文件，支持多个验证码配置，也支持实例化时传入配置进行覆盖（优先级最高）

使用
--

[](#使用)

### 模板里输出验证码

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

```
{:captcha_img()}
```

或者

```

```

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

### 接口输出验证码

[](#接口输出验证码)

```
class CaptchaController
{
    public function index($id = "", $configName = "")
    {
        $captcha = new Captcha(); // 可传入数组配置进行覆盖
        return $captcha->entry($id, $configName); // 可选择配置模式
    }
}
```

### 控制器里验证

[](#控制器里验证)

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

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

或者手动验证

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

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

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

2384d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b8a54eac6e1f748bc947581efd89a684838353116927057f5c98937fb1888c6?d=identicon)[hectorqin](/maintainers/hectorqin)

---

Tags

sdkcaptchathinkphpthink

### Embed Badge

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

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

###  Alternatives

[naixiaoxin/think-wechat

EasyWechat For Thnkphp5.1+

27316.1k1](/packages/naixiaoxin-think-wechat)[isszz/rotate-captcha

Rotate image captcha

801.7k](/packages/isszz-rotate-captcha)[xiaodi/think-pinyin

ThinkPHP 中文转拼音扩展包

344.6k](/packages/xiaodi-think-pinyin)[ichynul/tpextmyadmin

thinkphp extension

141.6k](/packages/ichynul-tpextmyadmin)

PHPackages © 2026

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