PHPackages                             mozafar/php-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. mozafar/php-validation

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

mozafar/php-validation
======================

A simple class for php request validation

v1.0.0(4y ago)03MITPHPPHP &gt;=7.0

Since Jul 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mozafar/php-validation)[ Packagist](https://packagist.org/packages/mozafar/php-validation)[ RSS](/packages/mozafar-php-validation/feed)WikiDiscussions develop Synced 3w ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

PHP simple validation class
===========================

[](#php-simple-validation-class)

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

[](#installation)

```
composer install mozafar/php-validation
```

Usage
-----

[](#usage)

Simply add class and pass `data` and `rules`:

```
use Mozafar\Validation\Validation;

$data = Validation::make($_POST, [
    'name' => ['required', 'string'],
    'email' => ['required', 'email']
])->throws()->validated();
```

If there are any errors it throws `ValidationException` and list of errors available in `$exception->errors()` like this:

```
use Mozafar\Validation\Validation;
use Mozafar\Validation\ValidationException;

try {
    Validation::make($_POST, [
        'name' => ['required', 'string'],
        'email' => ['required', 'email']
    ])->throws()->validated();

    return $data;
} catch (ValidationException $e) {
    return $e->errors();
}
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

1820d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/985ff86edb5c7f0f08f925e94916b06a7c9b29b1fd9b779fa0afd088ca56bc4b?d=identicon)[mozafar](/maintainers/mozafar)

---

Top Contributors

[![mozafar](https://avatars.githubusercontent.com/u/6140969?v=4)](https://github.com/mozafar "mozafar (5 commits)")

### Embed Badge

![Health badge](/badges/mozafar-php-validation/health.svg)

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

PHPackages © 2026

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