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

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

lyignore/captcha
================

a test for captcha

0.0.2(7y ago)09MITPHPPHP &gt;=5.5.5

Since Mar 7Pushed 7y agoCompare

[ Source](https://github.com/LYignore/captcha)[ Packagist](https://packagist.org/packages/lyignore/captcha)[ RSS](/packages/lyignore-captcha/feed)WikiDiscussions master Synced 3d ago

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

 captcha
=========

[](#-captcha-)

 a test for captcha.

Installing
----------

[](#installing)

```
$ composer require lyignore/captcha -vvv
```

Usage
-----

[](#usage)

```

use Lyignore\Captcha\NoCaptcha;

$config = [
    'sitekey' => '6LdKdYEUAAAAAJ5Tq5cIDOL0nWag21v9AP1sOU3w',
    'secret'  => '6LdKdYEUAAAAAGCLYLys2JOAbCgWnUIEzeuFwwyW',
    'callBackName' => 'googleCaptchaCallName',  //回调全局函数名称
    'type'  => 'dark',  //dark or light
];

$captcha = new NoCaptcha($config);

//设置验证成功后回调函数的名称，例如叫GoogleVerifiedSuccessfully为回调函数名称，并把返回值放到前端页面中
$captchaSuccFun = $captcha->setCallBack('GoogleVerifiedSuccessfully');

//可设置Google验证框的样式
$captcha->setType('light');

//获取谷歌验证码的前段代码，并且把其放到前端页面中
$captchaHtml = $captcha->getCaptcha();

//Google验证成功后设置的回调函数会收到response,将response通过AJAX传入后台进行验证
$response = '03AOLTBLSiSpVFSVfV6ozdutzzyniL2R-qEDVr_NPuXV70Wq-CeVPRiu0io9rx97wV88CtpQeFoqqmwaMRVYjGvWBUyj_Y2o-eVjH086iA2oV2t2mFCgF4QasjEz1P8R38HKFD9LNmIVHr96kPWnqoFcBHYVNTU0XkmuyyH6Dr-dN6ZjkTtNyfZiwBb8jAXgdQDAqtr1i3jAoc5oaGhv5cyIi1_WfOvqhLUMDv79WcPgUgSaQrGmTCZY9NVnkPhWVBqNE4bHjZAyZx4DszkI4XpQWp3fA3rGdim6g-hHF62rhFklwhiJQkcTyj1rP-Mz_K4OT5TwbubuXi';   //例如收到的response为此段随机字符串

//只能验证一次，判断是否是robot,非robot返回true,第二次验证不管是不是robot都会返回false
$captcha->verifyResponse($response);

```

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/lyignore/captcha/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/lyignore/captcha/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

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

Every ~0 days

Total

2

Last Release

2625d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d14ab89a56f320a46083354c9bbb5cdc474a3eb97b92b2644fa9f2fe08d8b43?d=identicon)[lyignore](/maintainers/lyignore)

---

Top Contributors

[![LYignore](https://avatars.githubusercontent.com/u/27730851?v=4)](https://github.com/LYignore "LYignore (7 commits)")

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[galahad/laravel-addressing

Laravel package providing addressing functionality

70316.6k](/packages/galahad-laravel-addressing)[danielebarbaro/laravel-vat-eu-validator

A simple package that validates EU VAT numbers against the central ec.europa.eu database

37369.4k](/packages/danielebarbaro-laravel-vat-eu-validator)[robertogallea/laravel-codicefiscale

Codice fiscale validation for php/laravel

58151.6k1](/packages/robertogallea-laravel-codicefiscale)[bayareawebpro/laravel-multistep-forms

Responsable MultiStep Form Builder for Laravel.

967.9k](/packages/bayareawebpro-laravel-multistep-forms)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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