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)250MITPHPPHP ^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 3d 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

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Every ~109 days

Recently: every ~136 days

Total

6

Last Release

1993d 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

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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