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

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

awurth/slim-validation
======================

A wrapper around the respect/validation PHP validation library for easier error handling and display

v5.0.1(2y ago)65378.4k—5.3%22[2 issues](https://github.com/awurth/SlimValidation/issues)9MITPHPPHP &gt;=8.1

Since Dec 9Pushed 2y ago3 watchersCompare

[ Source](https://github.com/awurth/SlimValidation)[ Packagist](https://packagist.org/packages/awurth/slim-validation)[ Docs](https://github.com/awurth/SlimValidation)[ RSS](/packages/awurth-slim-validation/feed)WikiDiscussions 5.x Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (30)Used By (9)

Slim Validation
===============

[](#slim-validation)

[![CI](https://github.com/awurth/SlimValidation/actions/workflows/ci.yml/badge.svg)](https://github.com/awurth/SlimValidation/actions/workflows/ci.yml)[![Latest Stable Version](https://camo.githubusercontent.com/7673a38f6fcff9b3355bb7fe98919d7fc3d6ddde9cdb76f930d90508cd332f9c/68747470733a2f2f706f7365722e707567782e6f72672f6177757274682f736c696d2d76616c69646174696f6e2f762f737461626c65)](https://packagist.org/packages/awurth/slim-validation)[![License](https://camo.githubusercontent.com/4958f1470bed7a83c015f8bba02700d85c114d68e16519c52a112fe781f67e94/68747470733a2f2f706f7365722e707567782e6f72672f6177757274682f736c696d2d76616c69646174696f6e2f6c6963656e7365)](https://packagist.org/packages/awurth/slim-validation)

[![Total Downloads](https://camo.githubusercontent.com/48b8ef6e169f345bd7bb8bf09e81c85864754ab4130844e14cd96e78f5c60fcc/68747470733a2f2f706f7365722e707567782e6f72672f6177757274682f736c696d2d76616c69646174696f6e2f646f776e6c6f616473)](https://packagist.org/packages/awurth/slim-validation)[![Monthly Downloads](https://camo.githubusercontent.com/36947721203f4c86b8292141f3b39d65cf25fe2bfb99f13c97b59454fa13b9f6/687474703a2f2f706f7365722e707567782e6f72672f6177757274682f736c696d2d76616c69646174696f6e2f642f6d6f6e74686c79)](https://packagist.org/packages/awurth/slim-validation)

A wrapper around the [Respect Validation](https://github.com/Respect/Validation) PHP validation library for easier error handling and display

> This project was originally designed to be used with the Micro-Framework "Slim", hence the name "Slim Validation", but can now be used in any other PHP project.

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

[](#installation)

```
$ composer require awurth/slim-validation
```

Documentation
-------------

[](#documentation)

- [**5.x**](https://github.com/awurth/SlimValidation/tree/5.x/docs) (current, PHP &gt;= 8.1)
- [**3.4**](https://github.com/awurth/SlimValidation/tree/3.x/docs) (outdated, PHP &gt;= 7.1)

Usage
-----

[](#usage)

The following example shows how to validate that a string is at least 10 characters long:

```
use Awurth\Validator\Validator;
use Respect\Validation\Validator as V;

$validator = Validator::create();
$failures = $validator->validate('Too short', V::notBlank()->length(min: 10));

if (0 !== $failures->count()) {
    // Validation failed: display errors
    foreach ($failures as $failure) {
        echo $failure->getMessage();
    }
}
```

The `validate()` method returns a list of validation failures as an object that implements [`ValidationFailureCollectionInterface`](src/ValidationFailureCollectionInterface.php). If you have lots of validation failures, you can filter them with a callback:

```
use Awurth\Validator\ValidationFailureInterface;

$failures = $validator->validate(/* ... */);
$filteredFailures = $failures->filter(static function (ValidationFailureInterface $failure, int $index): bool {
    return $failure->getRuleName() === 'notBlank';
});
```

License
-------

[](#license)

This package is available under the [MIT license](LICENSE).

[![Buy Me A Coffee](https://camo.githubusercontent.com/6d00276d6e09b1c1a8391562c40e2c387f266c3518fdb25a19429d30aa22ef7a/68747470733a2f2f63646e2e6275796d6561636f666665652e636f6d2f627574746f6e732f76322f64656661756c742d677265656e2e706e67)](https://www.buymeacoffee.com/awurth)

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 97.1% 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 ~88 days

Recently: every ~205 days

Total

30

Last Release

883d ago

Major Versions

1.4.1 → 2.0.02017-04-02

2.1.3 → 3.0.02017-09-21

2.x-dev → 3.0.12017-10-28

3.3.0 → 4.x-dev2020-11-08

v3.4.0 → v5.0.02023-04-10

PHP version history (4 changes)3.0.0PHP ^7.0

4.x-devPHP &gt;=7.2

3.x-devPHP &gt;=7.1

v5.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/f013869636e144de4543214232772d5e07d399ec61df8a586ba3e0df30a5b193?d=identicon)[Alexis Wurth](/maintainers/Alexis%20Wurth)

---

Top Contributors

[![awurth](https://avatars.githubusercontent.com/u/10026857?v=4)](https://github.com/awurth "awurth (202 commits)")[![khrizt](https://avatars.githubusercontent.com/u/725227?v=4)](https://github.com/khrizt "khrizt (3 commits)")[![Alph44rchitect](https://avatars.githubusercontent.com/u/9463303?v=4)](https://github.com/Alph44rchitect "Alph44rchitect (1 commits)")[![DeeFuse](https://avatars.githubusercontent.com/u/7376678?v=4)](https://github.com/DeeFuse "DeeFuse (1 commits)")[![Gomes81](https://avatars.githubusercontent.com/u/1794381?v=4)](https://github.com/Gomes81 "Gomes81 (1 commits)")

---

Tags

phprespectslimtwig-extensionvalidationvalidatorvalidatorvalidationrespectslimvalidate

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[respect/validation

The most awesome validation engine ever created for PHP

5.9k37.4M383](/packages/respect-validation)[wixel/gump

A fast, extensible &amp; stand-alone PHP input validation class that allows you to validate any data.

1.2k1.3M30](/packages/wixel-gump)[sadegh19b/laravel-persian-validation

A comprehensive Laravel validation package for Persian text, numbers, dates, and Iranian national identifiers

18293.8k1](/packages/sadegh19b-laravel-persian-validation)[workerman/validation

The most awesome validation engine ever created for PHP. Respect/Validation 汉化版本

2334.1k9](/packages/workerman-validation)[romeoz/rock-validate

Flexible validator for PHP with I18N.

251.7k6](/packages/romeoz-rock-validate)

PHPackages © 2026

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