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

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

laoshifu/think-captcha
======================

ThinkPHP 8.0 验证码扩展包

v1.0.1(5mo ago)03Apache-2.0PHPPHP &gt;=8.0.0

Since Dec 8Pushed 5mo agoCompare

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

READMEChangelogDependenciesVersions (4)Used By (0)

ThinkPHP 8.0 验证码扩展
==================

[](#thinkphp-80-验证码扩展)

适用于 ThinkPHP 8.0+ 的验证码扩展包。

安装
--

[](#安装)

```
composer require laoshifu/think-captcha
```

功能特性
----

[](#功能特性)

- 支持自定义验证码长度
- 支持自定义字体
- 支持自定义背景图
- 支持中文验证码
- 支持算术验证码

使用方法
----

[](#使用方法)

### 生成验证码

[](#生成验证码)

```
use laoshifu\captcha\facade\Captcha;

// 生成验证码图片
return Captcha::create();

// 生成算术验证码
return Captcha::create('math');
```

### 验证

[](#验证)

```
use laoshifu\captcha\facade\Captcha;

// 验证用户输入
if (Captcha::check($code)) {
    // 验证成功
}
```

配置
--

[](#配置)

在 `config/captcha.php` 中配置：

```
return [
    // 验证码字符集
    'codeSet' => '2345678abcdefhijkmnpqrstuvwxyzABCDEFGHJKLMNPQRTUVWXY',
    // 验证码长度
    'length' => 4,
    // 验证码字体大小
    'fontSize' => 25,
    // 是否使用中文验证码
    'useZh' => false,
    // 是否使用算术验证码
    'math' => false,
    // 验证码图片宽度
    'imageW' => 220,
    // 验证码图片高度
    'imageH' => 60,
];
```

版权信息
----

[](#版权信息)

Copyright © 2025 贵州老师傅到家科技有限公司

Licensed under the Apache License 2.0

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance78

Regular maintenance activity

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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

152d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b5284724bd18a90cb9227fdf8899f132e73e7b1b19b292fb305cf1d0fb64a16?d=identicon)[love827396593-wq](/maintainers/love827396593-wq)

---

Top Contributors

[![tolollipop](https://avatars.githubusercontent.com/u/17916666?v=4)](https://github.com/tolollipop "tolollipop (4 commits)")[![laoshifu-tech](https://avatars.githubusercontent.com/u/234569004?v=4)](https://github.com/laoshifu-tech "laoshifu-tech (1 commits)")

---

Tags

captchathinkphp

### Embed Badge

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

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

###  Alternatives

[karser/karser-recaptcha3-bundle

Google ReCAPTCHA v3 for Symfony

1862.4M7](/packages/karser-karser-recaptcha3-bundle)[laminas/laminas-captcha

Generate and validate CAPTCHAs using Figlets, images, ReCaptcha, and more

2318.5M43](/packages/laminas-laminas-captcha)[captcha-com/symfony-captcha-bundle

Symfony Captcha Bundle -- BotDetect PHP CAPTCHA generator integration for the Symfony framework.

3991.6k](/packages/captcha-com-symfony-captcha-bundle)[abanoubnassem/filament-grecaptcha-field

Provides a Google reCaptcha V2 field for the Filament Forms

27116.1k2](/packages/abanoubnassem-filament-grecaptcha-field)[aryehraber/statamic-captcha

Protect your Statamic forms using a Captcha service

16194.4k](/packages/aryehraber-statamic-captcha)[mobicms/captcha

A simple PHP CAPTCHA library

2616.4k2](/packages/mobicms-captcha)

PHPackages © 2026

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