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

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

kickpeach/validate
==================

0251[1 PRs](https://github.com/KickPeach/validate/pulls)PHPCI passing

Since May 23Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/KickPeach/validate)[ Packagist](https://packagist.org/packages/kickpeach/validate)[ RSS](/packages/kickpeach-validate/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (3)Used By (0)

validate
========

[](#validate)

校验请求参数，需要对抛出的一场进行捕捉处理

安装
==

[](#安装)

```
composer require kickpeach/validate

```

使用
==

[](#使用)

```
            $data = [
                'name'=>'111',
                'avatar'=>'',
            ];

            $rules = [
                'name'=>'required|lengthMax:2',
                'avatar'=>'required|url',
            ];

            $errors = [
                  'name.require'=>'名字不能为空'
            ];

            $data =  Validate::validated($data,$rules,$errors);
```

- 可以使用的rule，可查看Rule.php

TODO
====

[](#todo)

- 开发者可扩展自己的rule
- 支持使用匿名函数

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance57

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4feffac62baecf873c8941e414747c4907f2110f1d31070d8a20fb1ecbf3e52a?d=identicon)[sevenshi](/maintainers/sevenshi)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[chaoswey/taiwan-id-validator

台灣身分證、統一編號驗證

319.9k](/packages/chaoswey-taiwan-id-validator)

PHPackages © 2026

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