PHPackages                             harry-ykh/php-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. harry-ykh/php-validate

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

harry-ykh/php-validate
======================

A standalone, framework-agnostic PHP validation library refactored from ThinkPHP's validator. 这是一个基于 ThinkPHP 框架验证器改造的独立 PHP 验证库，可用于任何 PHP 项目。

v1.9(4mo ago)028Apache-2.0PHPPHP &gt;=8.1

Since Dec 3Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/harryYKH/phpValidate)[ Packagist](https://packagist.org/packages/harry-ykh/php-validate)[ RSS](/packages/harry-ykh-php-validate/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)DependenciesVersions (11)Used By (0)

PHP Validate
============

[](#php-validate)

A standalone, framework-agnostic PHP validation library refactored from ThinkPHP's validator. 这是一个基于 ThinkPHP 框架验证器改造的独立 PHP 验证库，可用于任何 PHP 项目。

Features / 特性
-------------

[](#features--特性)

- **Framework Agnostic / 框架无关**: Can be used in any PHP project (Laravel, Symfony, Slim, plain PHP, etc.).
- **Standalone / 独立**: No dependencies on ThinkPHP core, ORM, or other components.
- **Easy to Use / 简单易用**: Familiar API for ThinkPHP users.

Requirements / 环境要求
-------------------

[](#requirements--环境要求)

- PHP &gt;= 8.1

Installation / 安装
-----------------

[](#installation--安装)

```
composer require harry-ykh/php-validate
```

Usage / 使用
----------

[](#usage--使用)

```
use harry\Validate;

$data = [
    'name' => 'harry',
    'email' => 'test@example.com'
];

$validate = new Validate();
$validate->rule([
    'name'  => 'require|max:25',
    'email' => 'email'
]);

if (!$validate->check($data)) {
    var_dump($validate->getError());
}
```

Removed Features / 移除的特性
------------------------

[](#removed-features--移除的特性)

Compared to the original ThinkPHP validator, the following dependencies have been removed: 相较于原版 ThinkPHP 验证器，移除了以下依赖：

- **Database Unique Validation / 数据库唯一性验证**: Removed dependency on `think-orm` (`unique` rule).
- **Multi-language Support / 多语言支持**: Removed dependency on `think-lang` (Simplified error messages).
- **Token Validation / 表单令牌**: Removed dependency on `think-session/request` (`token` rule).

License
-------

[](#license)

Apache-2.0

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance76

Regular maintenance activity

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

Recently: every ~95 days

Total

10

Last Release

131d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8512a2c400024624193e295f86506c83d9689d17518968bfb482c0e92ba66d1e?d=identicon)[xichunjian](/maintainers/xichunjian)

---

Tags

phpvalidationvalidatestandaloneframework agnosticthinkphp

### Embed Badge

![Health badge](/badges/harry-ykh-php-validate/health.svg)

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

PHPackages © 2026

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