PHPackages                             cwy104/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. [Security](/categories/security)
4. /
5. cwy104/think-captcha

ActiveLibrary[Security](/categories/security)

cwy104/think-captcha
====================

captcha package for thinkphp，前后端分离，api接口调用

0.2(3y ago)05Apache-2.0PHPPHP &gt;=7.1.0

Since Jul 28Pushed 3y ago1 watchersCompare

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

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

cwy104/think-captcha
====================

[](#cwy104think-captcha)

thinkphp6 接口验证码类库

安装
--

[](#安装)

> composer require cwy104/think-captcha

使用
--

[](#使用)

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

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

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

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

```

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

### 输出验证码

[](#输出验证码)

注册一个验证码路由规则。

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

```

### 控制器里验证

[](#控制器里验证)

使用TP的内置验证功能即可,验证码格式key-value

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

```

或者手动验证

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

```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

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

Total

2

Last Release

1388d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5240a3904c0a1190e11ddce0f4cb6ca1be05cb2fc5250f355b5b783911f8e22a?d=identicon)[cwy104](/maintainers/cwy104)

---

Top Contributors

[![cwy104](https://avatars.githubusercontent.com/u/3941258?v=4)](https://github.com/cwy104 "cwy104 (3 commits)")

### Embed Badge

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

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)

PHPackages © 2026

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