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

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

indiboy/think-captcha-restful
=============================

captcha restful package for thinkphp

v3.0.3(5y ago)06Apache-2.0PHP

Since May 11Pushed 5y agoCompare

[ Source](https://github.com/indiboy/think-captcha-restful)[ Packagist](https://packagist.org/packages/indiboy/think-captcha-restful)[ RSS](/packages/indiboy-think-captcha-restful/feed)WikiDiscussions 3.0 Synced 1mo ago

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

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

[](#think-captcha)

thinkphp6 验证码类库

安装
--

[](#安装)

> composer require topthink/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

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~89 days

Recently: every ~110 days

Total

18

Last Release

2140d ago

Major Versions

v1.0.7 → v2.0.12017-10-16

v1.0.8 → v3.0.02019-04-17

### Community

Maintainers

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

---

Top Contributors

[![liu21st](https://avatars.githubusercontent.com/u/1111670?v=4)](https://github.com/liu21st "liu21st (15 commits)")[![yunwuxin](https://avatars.githubusercontent.com/u/2168125?v=4)](https://github.com/yunwuxin "yunwuxin (14 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)")

### Embed Badge

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

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

###  Alternatives

[topthink/think-captcha

captcha package for thinkphp

132934.4k68](/packages/topthink-think-captcha)[topthink/think-worker

workerman extend for thinkphp

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

计划任务

17416.2k](/packages/yunwuxin-think-cron)[zzstudio/think-addons

The ThinkPHP6 Addons Package

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

Annotation For ThinkPHP

4831.5k8](/packages/topthink-think-annotation)[liliuwei/thinkphp-jump

适用于thinkphp6.0的跳转扩展

2874.4k1](/packages/liliuwei-thinkphp-jump)

PHPackages © 2026

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