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

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

muizabdul29/simple-validator
============================

v1.2.0(8y ago)125MITPHPPHP &gt;=7.1

Since Nov 4Pushed 8y ago1 watchersCompare

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

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

Simple Validator for PHP
------------------------

[](#simple-validator-for-php)

Simple Validator is simple PHP library for validation purposes. It requires NO dependencies. It is inspired by [vlucas/valitron](https://github.com/vlucas/valitron). Following are the differences between the two:

- Style of defining rules is different. In [valitron](https://github.com/vlucas/valitron), it is done rules-wise whereas in this library it is done field wise which is more easier to manage.
- It has been written from the scratch while keeping minimum required PHP version as 7.1. It has resulted in better (and much less) code.
- Keep in mind, it is not exactly same as [valitron](https://github.com/vlucas/valitron) and contains comparitively less (and different) features.

Requirements
------------

[](#requirements)

Simple Validator requires PHP 7.1 or newer.

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

[](#installation)

You can install it using [composer](http://getcomposer.org)

```
composer require muizabdul29/simple-validator

```

Examples
--------

[](#examples)

1. Basic Usage:

```
use Simple\Validator;

// This may be $_POST variable or whatever
$data = [
    'name' => 'Abdul Muiz'
];

// This is how you define rules
$rules = [
    'name' => [ 'required', ['lengthBetween', 2, 16] ]
];

$v = new Validator();

if ($v->validate($rules, $data)) {
    echo 'Valid';
} else {
    echo 'Invalid';
}
```

NOTE: The documentation is incomplete.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

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

Recently: every ~0 days

Total

11

Last Release

3050d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ce79c44c2845573c48e1ecd29adf0a9091222acba57e06fcf509ceca7efd0c7?d=identicon)[muizabdul29](/maintainers/muizabdul29)

---

Top Contributors

[![muizabdul29](https://avatars.githubusercontent.com/u/20123334?v=4)](https://github.com/muizabdul29 "muizabdul29 (23 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/muizabdul29-simple-validator/health.svg)](https://phpackages.com/packages/muizabdul29-simple-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)[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)
