PHPackages                             leedom/leedom-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. leedom/leedom-captcha

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

leedom/leedom-captcha
=====================

support TP6 usapi captcha, base on topthink\\framework

v1.0(4y ago)111MITPHPPHP ^7.1.0

Since Jul 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/leedom-hub/leedom-captcha)[ Packagist](https://packagist.org/packages/leedom/leedom-captcha)[ RSS](/packages/leedom-leedom-captcha/feed)WikiDiscussions master Synced today

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

leedom-captcha
==============

[](#leedom-captcha)

For support TP6 framework to use api model captcha.
It can be return the custom captcha data;
---------------------------------------------------------------------------------------------

[](#for-support-tp6-framework-to-use-api-model-captchait-can-be-return-the-custom-captcha-data)

**NOTICE:** *If you already installed the* `topthink/think-captcha` *you should remove it first!*

#### remove `topthink/think-captcha:`

[](#remove-topthinkthink-captcha)

`composer remove topthink/think-captcha`

```
eg: return a json response
    {
        "base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAA+BAMAAACcvUmpAAAAG1BMVEXz+/6MAii/fpOYIUKlQF3Mna2yX3jZvMjm2+PG163yAAAACXBIWXMAAA7EAAAOxAGVKw4bAAACDElEQVRYhe2WwW/TMBSHrWadfeTXtFmPiQaCIwYhONY9TDu2GivXWQi048KQ4BjYJP5tnqc2iR23SQjbyd8peXH82fHzcxgLBAKBQCDwaIjLJ5CsJ08gyR5bUhjJbFgfm7fLmwOPuZoPl9wDmBaN8I+dWMjpcInCmcIHJyg0cL29zpGS5GSIQ2DOhIqdaE7TM30bRjgZKuFYMBZh5ZjxYoNke6fi4j/MhAab2mZJ3+92F7zDFdPzIRKmaRZc2RI2utnqH5SYDZUcI175n+hdRq1R9JOcYulELhD790m5y4+x0M96OI4oa941LP6aocuwnPSSZPgqaR1L+HRlgqmnqUCZUTlkH4maUerUBs6NkcPXxRFe7y7HqK67SGgBf6E+XPO29Cwrl6iWSveSZIlZx1o6aapbZbLW+CbxvrqLzJbtTESf39p6d0g+XTS6GH8GkqK6Fz0kgmpqQpLaTIQyZcrOYfGcQm+Kekh1l+QpjXzBvtff51Rwz61WG0nF/5X9przqLKHtJVTiRv/Y81gD8Uu3TT3t2yQzk5npwTZUgb8UbpBjT+nxkE/MSddShrJGSTAja3j3Epm2uuUkpVQ4d0K/H47gjoxN7qu245q2YWpH8sb5fIgMy4+enecwcqt/ZOdzC2NZnd0HuPf9v3RnJD3L2uR2T/XviPjZqVnWY6X/GXHd3iYQCAQCe/kLeZlAHy8EvPIAAAAASUVORK5CYII=",
        "key": "$2y$10$3IL1VgxvnVrvQNcb12zNT.WFfmicBfyMQFE/S/1poM48oKzh03yr2",
        "code": "ss2y",
        "md5": "398c76a34d6adb0e6cdda01259ddb88f"
    }

    //base64 => the pic url
    //key => the ID key
    //md5 => the key's crypto
    //code => pic's resault (not safe )

```

---

About the `code`
----------------

[](#about-the-code)

> The response of `code` is the captcha's content,
> so return the `code` is not safe.
> You can change the `.env` file to return 0, eg:
>
> > \[APP\]
> > APP\_STATUS = dev

Install
-------

[](#install)

`composer require leedom/leedom-captcha`

In api model
------------

[](#in-api-model)

> use leedom\\captcha\\facade\\CaptchaApi;
>
> $data = CaptchaApi::create();

```
{
        "base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAA+BAMAAACcvUmpAAAAG1BMVEXz+/6MAii/fpOYIUKlQF3Mna2yX3jZvMjm2+PG163yAAAACXBIWXMAAA7EAAAOxAGVKw4bAAACDElEQVRYhe2WwW/TMBSHrWadfeTXtFmPiQaCIwYhONY9TDu2GivXWQi048KQ4BjYJP5tnqc2iR23SQjbyd8peXH82fHzcxgLBAKBQCDwaIjLJ5CsJ08gyR5bUhjJbFgfm7fLmwOPuZoPl9wDmBaN8I+dWMjpcInCmcIHJyg0cL29zpGS5GSIQ2DOhIqdaE7TM30bRjgZKuFYMBZh5ZjxYoNke6fi4j/MhAab2mZJ3+92F7zDFdPzIRKmaRZc2RI2utnqH5SYDZUcI175n+hdRq1R9JOcYulELhD790m5y4+x0M96OI4oa941LP6aocuwnPSSZPgqaR1L+HRlgqmnqUCZUTlkH4maUerUBs6NkcPXxRFe7y7HqK67SGgBf6E+XPO29Cwrl6iWSveSZIlZx1o6aapbZbLW+CbxvrqLzJbtTESf39p6d0g+XTS6GH8GkqK6Fz0kgmpqQpLaTIQyZcrOYfGcQm+Kekh1l+QpjXzBvtff51Rwz61WG0nF/5X9przqLKHtJVTiRv/Y81gD8Uu3TT3t2yQzk5npwTZUgb8UbpBjT+nxkE/MSddShrJGSTAja3j3Epm2uuUkpVQ4d0K/H47gjoxN7qu245q2YWpH8sb5fIgMy4+enecwcqt/ZOdzC2NZnd0HuPf9v3RnJD3L2uR2T/XviPjZqVnWY6X/GXHd3iYQCAQCe/kLeZlAHy8EvPIAAAAASUVORK5CYII=",
        "key": "$2y$10$3IL1VgxvnVrvQNcb12zNT.WFfmicBfyMQFE/S/1poM48oKzh03yr2",
        "code": "ss2y",
        "md5": "398c76a34d6adb0e6cdda01259ddb88f"
    }

```

Check captcha
-------------

[](#check-captcha)

> CaptchaApi::check($code,$key);
> `code => user input; key => response's key`
> notice : use cache, depends on what driver you choise

At last
-------

[](#at-last)

```
also support original topthink/think-captcha

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

Unknown

Total

1

Last Release

1753d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1406322bcaa192cfe1724006429b5943b5320786fadcf4cc65aac8791896ca31?d=identicon)[leedom-hub](/maintainers/leedom-hub)

---

Top Contributors

[![leedom-hub](https://avatars.githubusercontent.com/u/29144583?v=4)](https://github.com/leedom-hub "leedom-hub (1 commits)")

### Embed Badge

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

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

###  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)
