PHPackages                             sharifi/symfony-validation-bundle - 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. sharifi/symfony-validation-bundle

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

sharifi/symfony-validation-bundle
=================================

Symfony SymfonyValidationBundle

211PHPCI failing

Since Sep 9Pushed 5y ago3 watchersCompare

[ Source](https://github.com/50bhan/SymfonyValidationBundle)[ Packagist](https://packagist.org/packages/sharifi/symfony-validation-bundle)[ RSS](/packages/sharifi-symfony-validation-bundle/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Provides a Form Request Validation for Symfony
==============================================

[](#provides-a-form-request-validation-for-symfony)

Introduction
------------

[](#introduction)

This package allows you to validate request parameters based on your rules and restrictions via form requests. Form requests are custom request classes that contain validation logic.

### Installation

[](#installation)

You can install the package via composer:

```
composer require sharifi/symfony-validation-bundle
```

### Creating Form Requests

[](#creating-form-requests)

To start, create a class which extends from `Sharifi\Bundle\SymfonyValidationBundle\Requests\FormRequest` and add your validation rules to the rules method:

```
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;
use Sharifi\Bundle\SymfonyValidationBundle\Requests\FormRequest;

class StoreBlogPost extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     */
    protected function rules(): array
    {
        return [
            'name' => [
                new Length(['max' => 255]),
                new NotBlank(),
            ],
        ];
    }
}
```

### Use a Form Request

[](#use-a-form-request)

So, how are the validation rules evaluated? All you need to do is type-hint the request on your controller method. The incoming form request is validated before the controller method is called, meaning you do not need to clutter your controller with any validation logic:

```
/**
 * Store the incoming blog post.
 */
public function store(StoreBlogPost $request): Response
{
    // The incoming request is valid...

    // Retrieve the validated input data...
    $validated = $request->validated();
}
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity33

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/5a2e729dd1324600e0ddecc2013e40f16d1488f1219618e93b580bb5f1f88944?d=identicon)[50bhan](/maintainers/50bhan)

---

Top Contributors

[![50bhan](https://avatars.githubusercontent.com/u/36772278?v=4)](https://github.com/50bhan "50bhan (12 commits)")

### Embed Badge

![Health badge](/badges/sharifi-symfony-validation-bundle/health.svg)

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

###  Alternatives

[marcosh/php-validation-dsl

A DSL for validating data in a functional fashion

483.9k](/packages/marcosh-php-validation-dsl)

PHPackages © 2026

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