PHPackages                             thinkphp5/validator - 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. thinkphp5/validator

ActiveLibrary

thinkphp5/validator
===================

validator

2.0.1(8y ago)4217MITPHP

Since Feb 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/RudyChow/thinkphp5-validator)[ Packagist](https://packagist.org/packages/thinkphp5/validator)[ RSS](/packages/thinkphp5-validator/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)DependenciesVersions (10)Used By (0)

README
------

[](#readme)

在thinkphp5的项目开发过程中经常要自己写验证器

但其实大多数验证规则都是通过数据库中的字段定义上进行修改而来的

由于之前用的是yii2，受到其gii2的启发

想着做一个基于thinkphp5的composer插件，用以生成对应的验证器

于是就有了这个库

怎么引用
----

[](#怎么引用)

### × 本地引用

[](#-本地引用)

`$ git clone xxxxxxxxxxx`

在开发项目中的composer.json添加

```
    "repositories": {
        "thinkphp5/validator": {
            "type": "path",
            "url": "/yourpath/thinkphp5/validator/"
        }
    },

```

最后在项目中运行composer命令

`$ composer require --dev thinkphp5/validator:dev-master`

> thinkphp5.1.\* 版本对应2.0分支

> thinkphp5.0.\* 版本对应1.0分支

### × composer引用

[](#-composer引用)

`$ composer require thinkphp5/validator`

> thinkphp5.1.\* 版本对应composer 2.\*版本

> thinkphp5.0.\* 版本对应composer 1.\*版本

怎么使用
----

[](#怎么使用)

1. 填写数据库连接信息
2. 浏览器中输入`http://yourproject/validator_builder`
3. 默认生成的验证器会在`APP_PATH/common/validate`中
4. 注意目录权限问题

效果
--

[](#效果)

[![alt img](https://camo.githubusercontent.com/05d15c071ca18f0677fc720d5cfbd363edd602821c359956a7a76a2fec3a0033/687474703a2f2f7778322e73696e61696d672e636e2f6c617267652f3633333765346663677931666f367466687171706c6a3231673030706271356a2e6a7067)](https://camo.githubusercontent.com/05d15c071ca18f0677fc720d5cfbd363edd602821c359956a7a76a2fec3a0033/687474703a2f2f7778322e73696e61696d672e636e2f6c617267652f3633333765346663677931666f367466687171706c6a3231673030706271356a2e6a7067)[![alt img](https://camo.githubusercontent.com/1858b8868bd2720bd926324e53a9d2c0f42374626736f5a97893752b50742949/687474703a2f2f7778332e73696e61696d672e636e2f6c617267652f3633333765346663677931666f376e3767657a64366a323167303070626163692e6a7067)](https://camo.githubusercontent.com/1858b8868bd2720bd926324e53a9d2c0f42374626736f5a97893752b50742949/687474703a2f2f7778332e73696e61696d672e636e2f6c617267652f3633333765346663677931666f376e3767657a64366a323167303070626163692e6a7067)[![alt img](https://camo.githubusercontent.com/5818afd3104294a3558d8d0486a6072b2d0e89292fefb34a1308a7272e0f7a3c/687474703a2f2f7778332e73696e61696d672e636e2f6c617267652f3633333765346663677931666f367466687267746b6a32306b6630706e7769392e6a7067)](https://camo.githubusercontent.com/5818afd3104294a3558d8d0486a6072b2d0e89292fefb34a1308a7272e0f7a3c/687474703a2f2f7778332e73696e61696d672e636e2f6c617267652f3633333765346663677931666f367466687267746b6a32306b6630706e7769392e6a7067)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity69

Established project with proven stability

 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 ~3 days

Total

9

Last Release

2994d ago

Major Versions

1.0.x-dev → 2.0.02018-02-09

1.1.2 → 2.0.12018-03-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/21a3d9c9baf692f49bc8b9e391ede61dd45aa6bb9f94e347e07aeb2577e0b4fd?d=identicon)[Rudy](/maintainers/Rudy)

---

Top Contributors

[![RudyChow](https://avatars.githubusercontent.com/u/23711728?v=4)](https://github.com/RudyChow "RudyChow (8 commits)")

### Embed Badge

![Health badge](/badges/thinkphp5-validator/health.svg)

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

PHPackages © 2026

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