PHPackages                             bileji/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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. bileji/validator

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

bileji/validator
================

deep level data validator

1.0.0(9y ago)138MITPHPPHP &gt;=5.3.0

Since Sep 9Pushed 9y ago1 watchersCompare

[ Source](https://github.com/bileji/validator)[ Packagist](https://packagist.org/packages/bileji/validator)[ RSS](/packages/bileji-validator/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Installation
------------

[](#installation)

The suggested installation method is via [composer](https://getcomposer.org/):

```
php composer.phar require "bileji/validator:~1.0.0"
```

Usage
-----

[](#usage)

### Example

[](#example)

```
$validator = new \Bileji\Validator\Validator();

$validator->execute([
    "fruit" => "apple",
    "attribute" => [
        [
            "price" => 5,
            "time" => "2016-03-14 12:00:00"
        ],
        [
            "price" => 4,
            "time" => "2016-03-15 12:00:00"
        ]
    ],
    "email" => "shuc324@gmail.com",
    "colors" => ["color1" => "red", "color2" => "green"]
], [
    "fruit" => "required|string",
    "attribute._.price" => "required|numeric",
    "attribute._.time" => "required|string",
    "email" => "email",
    "colors" => "required|map"
]);

if ($validator->fails()) {
    $validator->errors()->first()->getMessage();
} else {
    var_dump($validator->getData());
}

array(4) {
  ["fruit"]=>
  string(5) "apple"
  ["attribute"]=>
  array(2) {
    [0]=>
    array(2) {
      ["price"]=>
      string(1) "5"
      ["time"]=>
      string(19) "2016-03-14 12:00:00"
    }
    [1]=>
    array(2) {
      ["price"]=>
      string(1) "4"
      ["time"]=>
      string(19) "2016-03-15 12:00:00"
    }
  }
  ["email"]=>
  string(17) "shuc324@gmail.com"
  ["colors"]=>
  array(2) {
    ["color1"]=>
    string(3) "red"
    ["color2"]=>
    string(5) "green"
  }
}
```

Validator
---------

[](#validator)

```
map

list

string

numeric

float

required

between:min,max

url

email

phone

chinese

regex

before:time

after:time

enum:enum

```

Custom error message
--------------------

[](#custom-error-message)

```
$validator->withMessage([
    'fruit|required' => ":field的名字不能为空"
])->execute([
    "fruit" => "apple",
    "attribute" => [
        [
            "price" => 5,
            "time" => "2016-03-14 12:00:00"
        ],
        [
            "price" => 4,
            "time" => "2016-03-15 12:00:00"
        ]
    ],
    "email" => "shuc324@gmail.com",
    "colors" => ["color1" => "red", "color2" => "green"]
], [
    "fruit" => "required|string",
    "attribute._.price" => "required|numeric",
    "attribute._.time" => "required|string",
    "email" => "email",
    "colors" => "required|map"
]);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

3536d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e47fcbd5876729801b9c42c3288b1da0abce85b0cac611f50788329e9d85d8ca?d=identicon)[shuc324](/maintainers/shuc324)

---

Top Contributors

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

---

Tags

validatordeep level

### Embed Badge

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

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

###  Alternatives

[respect/validation

The most awesome validation engine ever created for PHP

5.9k37.4M383](/packages/respect-validation)[seld/jsonlint

JSON Linter

1.3k217.8M205](/packages/seld-jsonlint)[composer/spdx-licenses

SPDX licenses list and validation library.

1.4k184.2M25](/packages/composer-spdx-licenses)[opis/json-schema

Json Schema Validator for PHP

64236.9M186](/packages/opis-json-schema)[intervention/validation

Additional validation rules for the Laravel framework

6826.7M8](/packages/intervention-validation)[laminas/laminas-validator

Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria

15544.9M188](/packages/laminas-laminas-validator)

PHPackages © 2026

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