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

ActiveLibrary[Security](/categories/security)

hardai/think-captcha
====================

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

v0.0.1(1y ago)07Apache-2.0PHPPHP &gt;=8.0.0

Since Feb 24Pushed 1y ago1 watchersCompare

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

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

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

[](#think-captcha)

hinkphp8 接口验证码类库

安装
--

[](#安装)

> composer require hardai/think-captcha

使用
--

[](#使用)

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

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

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

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

```

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

### 输出验证码

[](#输出验证码)

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

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

```

### 控制器里验证

[](#控制器里验证)

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

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

```

或者手动验证

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

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance43

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

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

Unknown

Total

1

Last Release

449d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f722b0ba8466da29948c498c5410af98113707b9c9f5e96d036df1fce3389fa?d=identicon)[hardai520](/maintainers/hardai520)

---

Top Contributors

[![hardai520](https://avatars.githubusercontent.com/u/200357804?v=4)](https://github.com/hardai520 "hardai520 (1 commits)")

### Embed Badge

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

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[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

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

Realistic password strength estimation PHP library based on Zxcvbn JS

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

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)[paragonie/hidden-string

Encapsulate strings in an object to hide them from stack traces

7410.6M39](/packages/paragonie-hidden-string)

PHPackages © 2026

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