PHPackages                             dualmedia/symfony-request-dto-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. [Database &amp; ORM](/categories/database)
4. /
5. dualmedia/symfony-request-dto-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

dualmedia/symfony-request-dto-bundle
====================================

Symfony bundle which provides DTO object functionality and resolving

4.0.20(1mo ago)81.6k3[2 issues](https://github.com/dualmediaspzoo/symfony-request-dto-bundle/issues)MITPHPPHP &gt;=8.5

Since Dec 7Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/dualmediaspzoo/symfony-request-dto-bundle)[ Packagist](https://packagist.org/packages/dualmedia/symfony-request-dto-bundle)[ RSS](/packages/dualmedia-symfony-request-dto-bundle/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (43)Versions (41)Used By (0)

Symfony DTO Bundle
==================

[](#symfony-dto-bundle)

[![Packagist Downloads](https://camo.githubusercontent.com/dda0a036f97625c008c83add673eb0b7e2b805f87d92215bb804bf51105cf128/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6475616c6d656469612f73796d666f6e792d726571756573742d64746f2d62756e646c65)](https://packagist.org/packages/dualmedia/symfony-request-dto-bundle)

This bundle aims to lower the burden of typechecking, casting, loading entities and related annoyances of using requests in your api.

Bundle will automatically hook into [Doctrine ORM Bundle](https://github.com/doctrine/DoctrineBundle) and [Nelmio API Docs Bundle](https://github.com/nelmio/NelmioApiDocBundle) so no additional configuration should be needed.

Features
--------

[](#features)

- Automatic DTO resolution from controller arguments — no manual extraction, casting, or validation wiring
- Type coercion for scalars, enums (backed or by case name), dates, and uploaded files
- Doctrine entity loading directly from request fields (`#[FindOneBy]`, `#[FindBy]`)
- Validator integration — Symfony constraints on properties and fields are enforced in a single pass
- Nested DTOs, collections of DTOs, and `#[AsRoot]` for flat top-level payloads
- Nelmio API Doc integration — parameters, request bodies, enum cases, formats, and PHPDoc descriptions are described automatically
- Configurable request bags (query, body, headers, cookies, attributes, files) via `#[Bag]`
- Configurable custom `#[Action]`s for fields, entities and more. Set custom responses via an easy to handle event.
- Event hooks for resolved / invalid / action scenarios — return custom responses from listeners
- Symfony profiler panel with per-request DTO resolution timings
- Cached metadata via opcache-backed PHP files — near-zero reflection cost after warm-up

Install
-------

[](#install)

```
composer require dualmedia/symfony-request-dto-bundle

```

Then add the bundle to your `config/bundles.php` file like so

```
return [
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
    // other bundles ...
    DualMedia\DtoRequestBundle\DtoBundle::class => ['all' => true],
];
```

If applicable your Doctrine entity managers will be detected automatically and used as default providers for classes to be loaded with your requests if needed.

Quick start
-----------

[](#quick-start)

```
use DualMedia\DtoRequestBundle\Dto\AbstractDto;
use DualMedia\DtoRequestBundle\Dto\Attribute\Bag;
use DualMedia\DtoRequestBundle\Metadata\Enum\BagEnum;
use Symfony\Component\HttpFoundation\File\UploadedFile;

// input:
// [
//     'name' => 'John',
//     'age' => '25',
//     'score' => '9.5',
//     'active' => '1',
//     'avatar' => ,
// ]

class ProfileDto extends AbstractDto
{
    public string|null $name = null;

    public int|null $age = null;

    public float|null $score = null;

    public bool|null $active = null;

    #[Bag(BagEnum::Files)]
    public UploadedFile|null $avatar = null;
}
```

More examples
-------------

[](#more-examples)

See [EXAMPLES.md](EXAMPLES.md) for enums, dates, nested DTOs, entity loading, and root-level payloads.

Upgrades
--------

[](#upgrades)

See [CHANGES.md](CHANGES.md)

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance84

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 89.3% 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 ~32 days

Recently: every ~1 days

Total

39

Last Release

54d ago

Major Versions

1.0.0 → 2.1.02023-01-01

2.2.4 → 3.0.02024-03-05

3.4.1 → 4.0.02026-04-22

PHP version history (5 changes)1.0.0PHP ^7.4|^8.1

2.1.0PHP ^8.1

3.3.0PHP ^8.3

3.4.0PHP &gt;=8.4

4.0.0PHP &gt;=8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/0642c17604cd51622ad504c999eb75ba78e5768bfa998eaa2922366fc90f0302?d=identicon)[pkly](/maintainers/pkly)

---

Top Contributors

[![pkly](https://avatars.githubusercontent.com/u/17160364?v=4)](https://github.com/pkly "pkly (50 commits)")[![ozgaB](https://avatars.githubusercontent.com/u/65957239?v=4)](https://github.com/ozgaB "ozgaB (4 commits)")[![barturb](https://avatars.githubusercontent.com/u/16742048?v=4)](https://github.com/barturb "barturb (1 commits)")[![JaWitold](https://avatars.githubusercontent.com/u/47141012?v=4)](https://github.com/JaWitold "JaWitold (1 commits)")

---

Tags

doctrinephpsymfonysymfony-bundlerequestsymfonydto

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dualmedia-symfony-request-dto-bundle/health.svg)

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

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

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

2.6k50.1M314](/packages/api-platform-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

51390.8k2](/packages/web-auth-webauthn-framework)[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.

1155.2k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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