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

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

nicdamours/validator
====================

A simple, input validator that support chained command.

1.3.1(5y ago)254MITPHPPHP ^7.1.3CI failing

Since Jun 3Pushed 5y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (9)Used By (0)

Validator
=========

[](#validator)

This is a simple validator library to validate some input.

### Installation

[](#installation)

You can install it using composer :

```
composer require nicdamours/validator

```

### Usage

[](#usage)

To use the library, simply call the static method `make` of the Validator object, then select your input to validate, and use the `validate` function at the end.
 Ex:

```
    $myObject = [
        'name' => 'John Doe',
        'age' => 26,
        'isAdult' => true,
        'email' => 'j.doe@example.com',
        'birthdate' => '1990-01-01'
    ];

    return Validator::make($myObject)
                        ->name('name')
                        ->int('age')
                        ->boolean('isAdult')
                        ->email('email')
                        ->date('birthDate')
                        ->validate();
```

Be default, all parameters are optionals, unless you tell the validation function not to.
Ex :

```
    $myObject = [
        'name' => 'John Doe',
        'age' => null,
        'isAdult' => true,
        'email' => 'j.doe@example.com',
        'birthdate' => '1990-01-01'
    ];

    return Validator::make($myObject)
                        ->name('name', false) // this cannot be null.
                        ->int('age')
                        ->boolean('isAdult',  false) // this cannot be null.
                        ->email('email',  false) // this cannot be null.
                        ->date('birthDate',  false) // this cannot be null.
                        ->validate();
```

Currently, we support those validation method.

- email
- password ( 7 to 20 letter, number, special char, must have one uppercase )
- title
- datetime ( `YYYY-MM-DD hh:mm:ss` )
- date ( `YYYY-MM-DD` )
- isoDatetime ( `YYYY-MM-DDThh:mm:ss+0500` the timezone can be format `0500` or `05:00`, or any other number)
- boolean ( as boolean or string )
- id ( int )
- int
- arrayOfString
- arrayOfInt
- path ( `/var/www/html` )
- version ( Ex: 1, 1.2, 1.2.3);
- HEX color ( `#ffffff`, `#fff`)
- inArray ( if the element is in an array )

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Recently: every ~136 days

Total

6

Last Release

2041d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a8f9c3d419879f7930f044538278c5f50e78953650c5c615963d81b3e15f324?d=identicon)[nicDamours](/maintainers/nicDamours)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[chaoswey/taiwan-id-validator

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

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

PHPackages © 2026

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