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

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

pingle/validator
================

Server side user input validation library

05PHP

Since Feb 17Pushed 10y ago1 watchersCompare

[ Source](https://github.com/FaizRasool/PingleValidator)[ Packagist](https://packagist.org/packages/pingle/validator)[ RSS](/packages/pingle-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Pingle Validator
================

[](#pingle-validator)

[![Latest Stable Version](https://camo.githubusercontent.com/ce2937a706c7027b358e5775a9a6196f9482624c9c4317869820a059288118c4/68747470733a2f2f706f7365722e707567782e6f72672f617a692f76616c696461746f722f762f737461626c652e737667)](https://packagist.org/packages/pingle/validator) [![Total Downloads](https://camo.githubusercontent.com/c44f497c3766ce6707b0b3f6cb28c6e04aca1d786cc5420e0c3d3a3baefc67c3/68747470733a2f2f706f7365722e707567782e6f72672f617a692f76616c696461746f722f646f776e6c6f6164732e737667)](https://packagist.org/packages/pingle/validator) [![Latest Unstable Version](https://camo.githubusercontent.com/593f834adde46f38a7abcc433c717740b826dd8fd9c461aece8a26cc304a5b95/68747470733a2f2f706f7365722e707567782e6f72672f617a692f76616c696461746f722f762f756e737461626c652e737667)](https://packagist.org/packages/pingle/validator) [![License](https://camo.githubusercontent.com/1ceb6109ee7ac012589d7329526de98de85e80cc75f6a75debbc02c3b94a3ad2/68747470733a2f2f706f7365722e707567782e6f72672f617a692f76616c696461746f722f6c6963656e73652e737667)](https://packagist.org/packages/pingle/validator)

You can install **Validator** either via package download from github or via composer install. I encourage you to do the latter:

```
{
  "require": {
    "pingle/validator": "dev-master"
  }
}
```

This is a small PHP class that makes it easy to validate forms in your project specially larger forms. Pingle Validator class provide the validation for the user input on the server side.

Basic usage
-----------

[](#basic-usage)

```
namespace Pingle/Validator;

//initialize the class
$val = new Validator();

/*** use POST as the source ***/
$val->addSource($_POST);

/*** add a form field rule ***/
/*** addRule('name', 'type', required, min, max, trim, regex)***/
$val->addRule('name', 'string', true, 5, 255, true)
    ->addRule('email', 'email', true, 1, 255, true)
    ->addRule('website', 'url', false, 1, 255, true)
    ->addRule('age', 'numeric', true, 1, 100, true)
    ->addRule('salary', 'float', false, 1, 99999999, true)
    ->addRule('date', 'regex', true, 10, 10, true,"#^(((?:0?[1-9]|1[012])|(?:0?[1-9]|[12][0-9]|3[01])|([a-zA-Z]+))([.,]?[-.\\\/\s]))?(((?:0?[1-9]|1[012])|(?:0?[1-9]|[12][0-9]|3[01])|([a-zA-Z]+))([.,]?[-.\\\/\s]))?((?:20|19)[0-9]{2})$#");
/*** run the validation rules ***/
$val->run();
/*** if there are errors show them ***/
if(sizeof($val->errors) > 0)
{
    print_r($val->errors);
}
else
{
    $_POST=$val->sanitized;
}
```

### Validation Methods

[](#validation-methods)

---

1. string
2. email
3. url
4. numeric
5. float
6. regex
7. ipv4
8. ipv6
9. bool

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b60691058dd36166fd22531b23ec9efba48e6e648e1b009da530cfccec2c5c8f?d=identicon)[FaizRasool](/maintainers/FaizRasool)

---

Top Contributors

[![FaizRasool](https://avatars.githubusercontent.com/u/7045820?v=4)](https://github.com/FaizRasool "FaizRasool (17 commits)")

### Embed Badge

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

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