PHPackages                             amitkhare/easy-validation - 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. amitkhare/easy-validation

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

amitkhare/easy-validation
=========================

Easy Validation is an easy and simple PHP validation library

0.5.9(8y ago)1751MITPHPPHP &gt;=5.5.0

Since Sep 27Pushed 8y ago1 watchersCompare

[ Source](https://github.com/amitkhare/easy-validation)[ Packagist](https://packagist.org/packages/amitkhare/easy-validation)[ Docs](http://github.com/amitkhare/easy-validation)[ RSS](/packages/amitkhare-easy-validation/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (1)Versions (10)Used By (1)

amitkhare/easy-validation
=========================

[](#amitkhareeasy-validation)

Easy Validation is an easy to use PHP validation library

Install
-------

[](#install)

Run this command from the directory in which you want to install.

### Via Composer:

[](#via-composer)

```
php composer.phar require amitkhare/easy-validation

```

### Via Git:

[](#via-git)

```
git clone https://github.com/amitkhare/easy-validation.git

```

### Manual Install:

[](#manual-install)

```
Download: https://github.com/amitkhare/easy-validation/archive/master.zip
Extract it, require "PATH-TO/"."EasyValidation.php" where you want to use it.

```

Minimal Usage:
--------------

[](#minimal-usage)

```
setSource($_POST); // set data source array;

$v->setLocale("en-IN","PATH/TO/LOCALES/DIRECTORY/");

$v->check("email","required|email|unique:users.email|min:4|max:100");
$v->match("password","password_confirm","required|min:6|max:25");

if(!$v->isValid()){
    print_r($v->getStatus());
}
```

Usage:
------

[](#usage)

```
setSource($_POST); // set data source array;

// check bottom of this file for sample en-IN.lang file
$v->setLocale("en-IN","PATH/TO/LOCALES/DIRECTORY/");

$v->check("mobile","required|numeric|min:10|max:15");
$v->check("username","required|alphanum|unique:users.username|min:4|max:20");
$v->check("email","required|email|unique:users.email|min:4|max:100");

$v->match("password","password_confirm","required|min:6|max:25");

if(!$v->isValid()){
    print_r($v->getStatus());
}
```

Available Methods:
------------------

[](#available-methods)

```
> $v->setSource(array["FIELD"=>"VALUE"]);
> $v->setLocale("en-IN",PATH); // Path is optional
> $v->check("FIELD","RULES");
> $v->match("FIELD1","FIELD2","RULES");
> $v->isValid();  // returns true/false
> $v->getStatus(); // get error messages

```

Available Rules:
----------------

[](#available-rules)

```
> required
> email
> url
> numeric
> string
> float
> ipv4
> ipv6
> bool
> min
> max
> alphanum
> alphanumUnicode
> unique (avaiable only if instantiate EasyValidation With Database Details);

```

Sample en-IN.lang file \[\[ JSON FORMAT \]\]
--------------------------------------------

[](#sample-en-inlang-file---json-format-)

```
    {

    "FIELDS_DONT_MATCH" : "The `%s` dont match with `%s`.",
    "FIELD_REQUIRED" : "The `%s` is required.",
    "FIELD_NOT_SET" : "The `%s` field is not set.",

    "USERNAME":"Username",
    "FIRSTNAME":"First Name",
    "LASTNAME":"Last Name",
    "MIDDLENAME":"Middle Name",
    "EMAIL":"Email",
    "PASSWORD":"Password",
    "MOBILE":"Mobile",
    "PASSWORD_CONFIRM":"Password Confirm"

    }
```

TODO:
-----

[](#todo)

```
> Support for single field check like setField() in addition with setSource()

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

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

Recently: every ~19 days

Total

9

Last Release

3070d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/996432dec074fe5ed8ed00ac19c727c4ecc6f59f8b0f57c42f0d7c446e346d72?d=identicon)[amitkhare](/maintainers/amitkhare)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/amitkhare-easy-validation/health.svg)

```
[![Health](https://phpackages.com/badges/amitkhare-easy-validation/health.svg)](https://phpackages.com/packages/amitkhare-easy-validation)
```

###  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)[nette/forms

📝 Nette Forms: generating, validating and processing secure forms in PHP. Handy API, fully customizable, server &amp; client side validation and mature design.

54013.2M450](/packages/nette-forms)[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)

PHPackages © 2026

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