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

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity32

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

[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)
