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

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

hnllyrp/laravel-captcha
=======================

The captcha package for laravel

v1.0.0(2y ago)03MITPHPPHP ^7.2.5|^8.0

Since Oct 22Pushed 2y ago1 watchersCompare

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

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

laravel-captcha
===============

[](#laravel-captcha)

The captcha package for laravel 图形验证码

- 支持多种类型 数字字母验证码，算术验证码，中文验证码
- 支持在不同的页面使用(须配置不同的类型)
- 支持 api 接口使用

### 安装

[](#安装)

```
composer require hnllyrp/laravel-captcha

```

### 配置

[](#配置)

config/captcha.php

- 支持 type 默认 default, 算术 mathe, 背景图 image, 中文 chinese. 另可以自由组合支持更多配置
- 其他 配置 cache,session 可以使用 redis 驱动

### 使用

[](#使用)

- web端 demo

```

// 验证
$type = $request->input('type', 'default');
$validator = Validator::make($request->all(), [
     'captcha' => ['required', 'captcha:' . $type],
]);

// 或使用输助函数
if(!captcha_check($type, $value)){
 // 验证失败
}

```

- api端 demo

```
$.get("api/captcha",{}, function(data){
    var captcha = data.captcha; // base64图片
    var hash = data.hash; // 验证hash,验证接口须带上此参数

    $("#captcha_img").src(captcha);
});

// 前端需要把验证码的值与 hash值 去请求 后续的验证接口
// 后端接口验证
    $type = $request->input('type', 'default');
    $hash = $request->input('hash');
    $validator = Validator::make($request->all(), [
        'captcha' => ['required', 'captcha_api:' . $type . ',' . $hash],
    ]);

// 或使用输助函数
    if(!captcha_api_check($type, $value, $hash)){
        // 验证失败
    }

```

### 感谢：

[](#感谢)

-
-

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

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

Unknown

Total

1

Last Release

934d ago

### Community

Maintainers

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

---

Top Contributors

[![hnllyrp](https://avatars.githubusercontent.com/u/61678827?v=4)](https://github.com/hnllyrp "hnllyrp (6 commits)")

---

Tags

phplaravelcaptcha

### Embed Badge

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

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

###  Alternatives

[yorcreative/laravel-argonaut-dto

Argonaut is a lightweight Data Transfer Object (DTO) package for Laravel that supports nested casting, recursive serialization, and validation out of the box. Ideal for service layers, APIs, and clean architecture workflows.

1062.8k1](/packages/yorcreative-laravel-argonaut-dto)

PHPackages © 2026

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