PHPackages                             mbing/think-validate - 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. mbing/think-validate

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

mbing/think-validate
====================

thinkphp validate，thinkphp6.0的路由验证器中间件 - 验证器自动验证：在API接口开发过程中，往往需要先写好验证器再到路由或者控制器中引入对应的验证器以完成参数校验，现在可以使用本路由中间件接管，实现自动验证，让你的接口开发快人一步！

v1.0.0(6y ago)050Apache-2.0PHP

Since Dec 23Pushed 6y ago1 watchersCompare

[ Source](https://github.com/moobing/think-validate)[ Packagist](https://packagist.org/packages/mbing/think-validate)[ RSS](/packages/mbing-think-validate/feed)WikiDiscussions master Synced today

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

thinkphp6.0的路由中间件 - 验证器自动验证
===========================

[](#thinkphp60的路由中间件---验证器自动验证)

感谢下面文章的思路，由于TP6改动较大，文章的用法已过时，遂进行改进，向下支持TP5.1 &amp; TP5.0(旧版请使用文章的方式进行创建中间件使用) 推荐大家先看一下详细的说明再进行使用 【中间件】API开发实现自动校验参数：[https://www.kancloud.cn/xieyongfa123/thinkphp\_note/822627](https://www.kancloud.cn/xieyongfa123/thinkphp_note/822627)

在API接口开发过程中，往往需要先写好验证器再到路由或者控制器中引入对应的验证器以完成参数校验，现在可以使用本路由中间件接管，实现自动验证，让你的接口开发快人一步！

使用过程出现任何问题或技术交流，请QQ联系:942753064 (请备注来源github)

安装
--

[](#安装)

```
composer require mbing/think-validate

```

使用方法：在config/route.php中加入以下路由全局中间件即可
------------------------------------

[](#使用方法在configroutephp中加入以下路由全局中间件即可)

```
return [
    //'...'     => '...',//你的其他路由配置
    'middleware'    =>    [
    	// ...,  //你引入的其他路由中间件
        mbing\middleware\ThinkAutoValidate::class,//引入自动验证中间件
    ],
];
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

2384d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2140223?v=4)[Martin I. Demiddel](/maintainers/mbing)[@MBing](https://github.com/MBing)

---

Top Contributors

[![moobing](https://avatars.githubusercontent.com/u/31676598?v=4)](https://github.com/moobing "moobing (1 commits)")

### Embed Badge

![Health badge](/badges/mbing-think-validate/health.svg)

```
[![Health](https://phpackages.com/badges/mbing-think-validate/health.svg)](https://phpackages.com/packages/mbing-think-validate)
```

PHPackages © 2026

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