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

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

jjgrainger/validation
=====================

Extensible PHP validation

00PHPCI passing

Since Feb 13Pushed 3mo agoCompare

[ Source](https://github.com/jjgrainger/Validation)[ Packagist](https://packagist.org/packages/jjgrainger/validation)[ RSS](/packages/jjgrainger-validation/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Validation
==========

[](#validation)

[![Tests](https://github.com/jjgrainger/Validation/actions/workflows/test.yml/badge.svg)](https://github.com/jjgrainger/Validation/actions/workflows/test.yml) [![codecov](https://camo.githubusercontent.com/084e4954304205b13d730326b3b37a77c39b41503a1ca6424c7f7143dc4fa0df/68747470733a2f2f636f6465636f762e696f2f67682f6a6a677261696e6765722f56616c69646174696f6e2f67726170682f62616467652e7376673f746f6b656e3d3434433647453537364f)](https://codecov.io/gh/jjgrainger/Validation) [![Latest Stable Version](https://camo.githubusercontent.com/01bace62c42319c411c273d5a948c65f51203a5e102baff4fe416b4318a5a30c/68747470733a2f2f62616467656e2e6e65742f6769746875622f72656c656173652f6a6a677261696e6765722f56616c69646174696f6e2f737461626c65)](https://packagist.org/packages/jjgrainger/Validation) [![Total Downloads](https://camo.githubusercontent.com/c3eb7f3ea0d647cc80ce7fb2d9d54e243b0f68059ea1f6cb0d07472965a5fd4d/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f64742f6a6a677261696e6765722f56616c69646174696f6e)](https://packagist.org/packages/jjgrainger/Validation) [![License](https://camo.githubusercontent.com/052cfdddf85f949f941269afe11e268170c10e62bffc4ca3c5df91e0cb7e96b1/68747470733a2f2f62616467656e2e6e65742f6769746875622f6c6963656e73652f6a6a677261696e6765722f56616c69646174696f6e)](https://packagist.org/packages/jjgrainger/Validation)

> Extensible PHP validation

Work in progress...

```
use Validation\Validator;

// Create a Validator with an array of attributes and rules to validate against.
$validator = Validator::make([
    'name' => 'required',
    'email' => 'required|email',
    'password' => 'required',
    'confirm_password' => 'required|same:password',
]);

// Run input through the Validator and receive the result.
$result = $validator->validate([
    'name' => 'Test',
    'email' => 'example@example.com',
    'password' => 'secret',
    'password_confirm' => 'secret',
]);

// Check results and display messsages.
if ($result->fails()) {
    // Get the first message for an attribute.
    $message = $result->first('name');

    // Get all messages.
    $messages = $result->messages();
}
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance55

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 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/e75df324c03b826071d520965956f3bbb8353970080cdfb1c93a742ea0a4ee44?d=identicon)[jjgrainger](/maintainers/jjgrainger)

---

Top Contributors

[![jjgrainger](https://avatars.githubusercontent.com/u/904708?v=4)](https://github.com/jjgrainger "jjgrainger (53 commits)")

### Embed Badge

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

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