PHPackages                             thefunpower/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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. thefunpower/captcha

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

thefunpower/captcha
===================

captcha

v1.0.6(1y ago)064Apache-2.0PHP

Since Oct 25Pushed 9mo agoCompare

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

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

验证码
---

[](#验证码)

### 安装

[](#安装)

```
composer require thefunpower/captcha

```

腾讯云验证码
------

[](#腾讯云验证码)

### 配置

[](#配置)

```
captcha_drive = Tencent
tencent_secret_id =
tencent_secret_key =
tencent_captcha_app_id  =
tencent_captcha_app_key =

```

### 前端调用

[](#前端调用)

```

```

触发验证码

```
$('#t_captcha_input').trigger('click');

```

点击验证码后执行JS

```
$vue->method("after_captcha()","
	let f = {};
	//或
	f.captcha = {
		appid:this.form.appid,
		ticket:this.form.ticket,
		randstr:this.form.randstr,
	};
");

```

### 服务端验证

[](#服务端验证)

验证是POST中的captcha数组 `appid` `ticket` `randstr`

```
get_captcha_check();

```

### 腾讯云验证码

[](#腾讯云验证码-1)

tencent\_captcha\_app\_id tencent\_captcha\_app\_key 来源

tencent\_secret\_id tencent\_secret\_key 来源

阿里云验证码（弃用）
----------

[](#阿里云验证码弃用)

需要的逻辑是： 先JS前端自己验证，什么时候发送到服务端验证由业务确定。

截止2024年6月，无法通过JS自行验证，每次都需要发送到接口判断，无论用户是正确还是错误的都会计算次数。

### 配置

[](#配置-1)

```
captcha_drive = Aliyun
# 阿里云验证码
alibaba_cloud_access_key_id =
alibaba_cloud_access_key_secret =
# 场景名称 ID
alibaba_cloud_captcha_scene_id =
# 身份标
alibaba_cloud_captcha_prefix =
# 可不配置此项
alibaba_cloud_endpoint = captcha.cn-shanghai.aliyuncs.com

```

### 验证

[](#验证)

```
Route::post('/captcha/aliyun', function () {
	$flag = get_captcha_check();
	if(!$flag){
		return  json_success(['data'=>1]);
	}
});

```

### 开源协议

[](#开源协议)

[LICENSE](LICENSE)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance46

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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

Recently: every ~60 days

Total

7

Last Release

689d ago

### Community

Maintainers

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

---

Top Contributors

[![sunkangchina](https://avatars.githubusercontent.com/u/66815206?v=4)](https://github.com/sunkangchina "sunkangchina (16 commits)")

---

Tags

php

### Embed Badge

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

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

PHPackages © 2026

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