PHPackages                             kanelli/graph-validate-code - 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. kanelli/graph-validate-code

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

kanelli/graph-validate-code
===========================

038[2 PRs](https://github.com/lishuji/graph-validate-code/pulls)PHPCI passing

Since Mar 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/lishuji/graph-validate-code)[ Packagist](https://packagist.org/packages/kanelli/graph-validate-code)[ RSS](/packages/kanelli-graph-validate-code/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

 图形验证码
=======

[](#-图形验证码-)

### 安装

[](#安装)

```
$ composer require kanelli/graph-validate-code

$ php artisan vendor:publish --provider="Kanelli\GraphValidateCode\GraphValidateCodeServiceProvider"
```

### 配置

[](#配置)

1. 依赖Redis缓存，需要在 `.env` 中配置Redis的连接信息。

```
    REDIS_HOST=127.0.0.1
    REDIS_PASSWORD=null
    REDIS_PORT=6379

```

2. 在 `config/validate.php` 中增加如下部分：

```
    [
         'rand_number'     => env('RAND_NUMBER', '1234567890'), // 随机因子
         'width'           => env('WIDTH', 60), // 图片宽度
         'height'          => env('HEIGHT', 40), // 图片高度
    ];

```

3. 在 `config/app.php` 中增加如下部分：

```
    'providers' => [
        // ...
        Kanelli\GraphValidateCode\GraphValidateCodeServiceProvider::class,
    ],

    'aliases' => [
        // ...
        'GraphValidateCodeFacade' => Kanelli\GraphValidateCode\Facades\GraphValidateCodeFacade::class,
    ],

```

### 使用

[](#使用)

1. 使用Facade获取图片,并校验：

```
    GraphValidateCodeFacade::config(config('validate'))->getValidateImage('1234', '6666');

    GraphValidateCodeFacade::config(config('validate'))->checkCode('1234', '6666');

```

2. 使用provider获取图片,并校验：

```
    app('gvc')->config(config('validate'))->getValidateImage('1234', '3309');

    app('gvc')->config(config('validate'))->checkCode('1234', '3309');

```

### License

[](#license)

MIT

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/54f97da7e4d8f0ec0c748a6612859a50dfbc2fc7fb5d3043a25162f13b61e247?d=identicon)[kanelli](/maintainers/kanelli)

---

Top Contributors

[![lishuji](https://avatars.githubusercontent.com/u/18309244?v=4)](https://github.com/lishuji "lishuji (2 commits)")

### Embed Badge

![Health badge](/badges/kanelli-graph-validate-code/health.svg)

```
[![Health](https://phpackages.com/badges/kanelli-graph-validate-code/health.svg)](https://phpackages.com/packages/kanelli-graph-validate-code)
```

###  Alternatives

[streamcommon/promise

PHP-CLI promise implementation

142.0k](/packages/streamcommon-promise)

PHPackages © 2026

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