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(3mo ago)12116.8k↓18.5%3[1 issues](https://github.com/123inkt/symfony-validation-shorthand/issues)2MITPHPPHP &gt;=8.1CI passing

Since May 29Pushed 3mo 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 2d ago

READMEChangelog (10)Dependencies (16)Versions (16)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

56

—

FairBetter than 97% of packages

Maintenance76

Regular maintenance activity

Popularity40

Moderate usage in the ecosystem

Community21

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

119d 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

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M339](/packages/api-platform-core)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[api-platform/serializer

API Platform core Serializer

274.8M87](/packages/api-platform-serializer)[api-platform/validator

API Platform validator component

274.6M27](/packages/api-platform-validator)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)

PHPackages © 2026

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