PHPackages                             digitalrevolution/symfony-validation-shorthand - 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. digitalrevolution/symfony-validation-shorthand

ActiveSymfony-bundle[Validation &amp; Sanitization](/categories/validation)

digitalrevolution/symfony-validation-shorthand
==============================================

Validation shorthand for symfony

v2.0.2(2mo ago)12108.5k↑16.7%3[1 issues](https://github.com/123inkt/symfony-validation-shorthand/issues)2MITPHPPHP &gt;=8.1CI passing

Since May 29Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/123inkt/symfony-validation-shorthand)[ Packagist](https://packagist.org/packages/digitalrevolution/symfony-validation-shorthand)[ RSS](/packages/digitalrevolution-symfony-validation-shorthand/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (16)Versions (15)Used By (2)

[![Minimum PHP Version](https://camo.githubusercontent.com/230588f62e4b3ba29858fcfcf1bbfe253f82c4180088091d6c7d4c6c06d80145/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e312d383839324246)](https://php.net/)[![Minimum Symfony Version](https://camo.githubusercontent.com/992497ffd816cda0638ec1832ef1c6caac7185ddaa96a96d79f85e8f2ddf4880/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792d253345253344253230362e322d627269676874677265656e)](https://symfony.com/doc/current/validation.html)[![Run tests](https://github.com/123inkt/symfony-validation-shorthand/actions/workflows/test.yml/badge.svg)](https://github.com/123inkt/symfony-validation-shorthand/actions/workflows/test.yml/badge.svg)

Symfony Validation Shorthand
============================

[](#symfony-validation-shorthand)

A validation shorthand component for Symfony, similar to the syntax in the "illuminate/validator" package for Laravel.

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

[](#installation)

Include the library as dependency in your own project via:

```
composer require "digitalrevolution/symfony-validation-shorthand"

```

Usage
-----

[](#usage)

**Example**

```
$rules = [
    'name.first_name' => 'required|string|min:5',
    'name.last_name'  => 'string|min:6',                     // last name is optional
    'email'           => 'required|email',
    'password'        => 'required|string|between:7,40',
    'phone_number'    => 'required|regex:/^020\d+$/',
    'news_letter'     => 'required|bool',
    'tags?.*'         => 'required|string'                   // if tags is set, must be array of all strings with count > 0
];

// transform the rules into a Symfony Constraint tree
$constraint = (new ConstraintFactory)->fromRuleDefinitions($rules);

// validate the data
$violations = \Symfony\Component\Validator\Validation::createValidator()->validate($data, $constraint);
```

Validates:

```
[
    'name'         => [
        'first_name' => 'Peter',
        'last_name'  => 'Parker'
    ],
    'email'        => 'example@example.com',
    'password'     => 'hunter8',
    'phone_number' => '0201234678',
    'news_letter'  => 'on',
    'tags'         => ['sports', 'movies', 'music']
]

```

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

[](#documentation)

Full syntax and examples:

- [Shorthands](docs/available-shorthands.md)
- [Data validation](docs/data-validation.md)
- [Traversable data](docs/traversable-data.md)
- [Examples](docs/examples.md)

About us
--------

[](#about-us)

At 123inkt (Part of Digital Revolution B.V.), every day more than 50 development professionals are working on improving our internal ERP and our several shops. Do you want to join us? [We are looking for developers](https://www.werkenbij123inkt.nl/zoek-op-afdeling/it).

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance84

Actively maintained with recent releases

Popularity40

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 84.2% 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 ~175 days

Recently: every ~204 days

Total

13

Last Release

73d ago

Major Versions

v1.2.1 → v2.0.02025-12-29

PHP version history (5 changes)v1.0.0PHP 7.1.\* || 7.2.\* || 7.3.\*

v1.0.1PHP 7.1.\* || 7.2.\* || 7.3.\* || 7.4.\*

v1.0.2PHP &gt;=7.1

v1.0.5PHP &gt;=7.4

v1.2.0PHP &gt;=8.1

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/20e2ae81f6cffdb8c1b1a488b7f2f70270a5d1bf2a57aae09950697ac0ef3dad?d=identicon)[123Tim](/maintainers/123Tim)

---

Top Contributors

[![frankdekker](https://avatars.githubusercontent.com/u/2179983?v=4)](https://github.com/frankdekker "frankdekker (239 commits)")[![PrinsFrank](https://avatars.githubusercontent.com/u/25006490?v=4)](https://github.com/PrinsFrank "PrinsFrank (21 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (10 commits)")[![bram123](https://avatars.githubusercontent.com/u/7457368?v=4)](https://github.com/bram123 "bram123 (9 commits)")[![kavinsky](https://avatars.githubusercontent.com/u/373995?v=4)](https://github.com/kavinsky "kavinsky (5 commits)")

---

Tags

symfonysymfony-bundlevalidation

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/digitalrevolution-symfony-validation-shorthand/health.svg)

```
[![Health](https://phpackages.com/badges/digitalrevolution-symfony-validation-shorthand/health.svg)](https://phpackages.com/packages/digitalrevolution-symfony-validation-shorthand)
```

###  Alternatives

[sllh/iso-codes-validator

Symfony validator wrapper of ronanguilloux/isocodes

37299.8k2](/packages/sllh-iso-codes-validator)[digitalrevolution/symfony-request-validation

Automatic request validation for symfony

1296.0k](/packages/digitalrevolution-symfony-request-validation)

PHPackages © 2026

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