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

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

mithridatem/validation
======================

Attribute-based validation components

v0.1.3(7mo ago)696↓50%1MITPHPPHP &gt;=8.2CI passing

Since Oct 19Pushed 7mo agoCompare

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

READMEChangelog (1)Dependencies (1)Versions (5)Used By (0)

Mithridatem Validation
======================

[](#mithridatem-validation)

Librairie de validation basee sur les attributs PHP 8.2+. Elle permet d'annoter vos entites avec des contraintes et de les verifier via la classe `Validator`.

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

[](#installation)

```
composer require mithridatem/validation
```

Utilisation
-----------

[](#utilisation)

```
use Mithridatem\Validation\Validator;
use Mithridatem\Validation\Attributes\NotBlank;
use Mithridatem\Validation\Attributes\Length;

class Utilisateur
{
    #[NotBlank]
    #[Length(min: 3, max: 50)]
    private string $prenom;
}

$validator = new Validator();
$validator->validate(new Utilisateur());
```

En cas d'echec, le `Validator` leve une `Mithridatem\Validation\Exception\ValidationException`. Interceptez cette exception pour afficher ou journaliser le message.

Contraintes disponibles
-----------------------

[](#contraintes-disponibles)

- `NotBlank` : interdit les valeurs nulles ou les chaines vides
- `Length` : impose une longueur minimale et/ou maximale
- `Email` : valide une adresse electronique avec `FILTER_VALIDATE_EMAIL`
- `Pattern` : impose un pattern regex à une string
- `Negative` : impose une valeur négative à un entier
- `NegativeOrZero` : impose une valeur négative ou égale à zéro à un entier
- `Positive` : impose une valeur positive à un entier
- `PositiveOrZero` : impose une valeur positive ou égale à zéro à un entier

Developpement
-------------

[](#developpement)

```
composer install
composer test
```

Licence
-------

[](#licence)

Le projet est distribue sous licence MIT. Voir [LICENSE](LICENSE).

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance65

Regular maintenance activity

Popularity15

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.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

210d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/150d5fff87a8ea6a5a9088506de9c7b031c231ec22b89326d37852539629426c?d=identicon)[mithridatem](/maintainers/mithridatem)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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