Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Symfony Dto Bundle

Symfony Dto Bundle Laravel Package

hprotravel/symfony-dto-bundle

A Symfony bundle from HproTravel for working with data transfer objects (DTOs), helping structure request and response data, improve type safety, and keep application layers clean. It integrates DTO handling into Symfony projects.

View on GitHub
Deep Wiki
Context7

Data transfer object library for symfony applications

Frequently asked questions about Symfony Dto Bundle
Is hprotravel/symfony-dto-bundle compatible with Laravel?
No, not as a drop-in dependency. hprotravel/symfony-dto-bundle is a Symfony bundle, so its Bundle subclass, DI extension, configuration tree, and compiler passes do nothing in Laravel, which has no bundle or kernel registration concept. The underlying DTO classes and mapping metadata are framework-agnostic and may be portable, but you should harvest or fork them instead of expecting the bundle to boot in a Laravel app.
How do I install hprotravel/symfony-dto-bundle in a Laravel project?
There is no normal composer require path because the package is Bitbucket-hosted and not on Packagist. You would add a repositories VCS entry for https://bitbucket.org/hprotravel/symfony-dto-bundle.git, then supply SSH or token credentials in every CI runner and developer environment. Even after installation, the Symfony bundle will not register itself in Laravel, so installation alone gives you no working integration.
What is hprotravel/symfony-dto-bundle used for?
It is intended for Symfony applications that want typed data transfer objects for request and response payloads, with mapping and hydration handled by the bundle. The goal is cleaner application layers, better type safety, and less array-shuffling between controllers, services, and transport formats. Laravel teams can reuse the DTO pattern but not the Symfony-specific wiring.
Can I use the DTO classes without the Symfony bundle?
Yes, harvesting is the recommended path. Copy the DTO classes and mapping metadata into app/DataTransferObjects or an internal Composer package, and strip DependencyInjection, Resources/config, and the bundle class. Replace the Symfony bootstrapping with a Laravel service provider that binds the hydrator or serializer as a singleton, and keep validation in Form Requests or Laravel's validator if the DTOs are pure carriers.
How do I configure the DTO layer after forking it for Laravel?
A Symfony bundle uses a config tree and extension class; Laravel expects config/dto.php, mergeConfigFrom, and publishes. After forking, expose only the options you actually need, bind services in register(), and resolve them through constructor injection rather than facades. Delete any Symfony-only configuration that has no Laravel equivalent.
Does it support Laravel 11 and 12, and which PHP version is required?
The package does not publish a clear support matrix, so verify PHP and Symfony Serializer constraints in its composer.json before committing. If you fork it for Laravel, a sensible target is Laravel 11 or 12 on PHP 8.2+, which lets you use readonly classes and constructor promotion. Lock symfony/serializer only if the hydration behavior is genuinely differentiated; otherwise drop it.
How does it hydrate and serialize DTOs, and can I test that in Laravel?
The public description does not document the hydration mechanism, so inspect the source for constructor promotion, reflection, attributes, or Symfony Serializer usage. Test the error contract explicitly: malformed input should raise a typed exception rather than silently partially hydrate. In a Laravel fork, unit test the hydrator directly and integration test it through a Form Request or controller.
Is hprotravel/symfony-dto-bundle safe to use in production?
Treat it as high risk for production as-is. It has zero stars, zero dependents, Bitbucket-only hosting, no Packagist trust signal, an unknown license, unknown test coverage, and single-vendor maintenance. The safer production path is to harvest the DTO layer or fork it under your own namespace with a named owner and upgrade plan.
What license is hprotravel/symfony-dto-bundle under, and can I fork it?
The license is not stated in the available information, which is a blocker for forking or internal redistribution until confirmed. Ask the maintainer whether forking, modification, and private redistribution are permitted. Without a clear license you should not vendor the code into a private package.
What are the alternatives to this DTO bundle for Laravel?
For Laravel, consider Spatie Laravel Data, plain PHP 8.2 readonly classes, custom hydrators, and Form Requests for validation. If you need serializer behavior, symfony/serializer can be installed standalone and used manually, but only if it earns its complexity. For many teams, readonly DTO carriers plus Laravel validation cover the same ground with no third-party bundle.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle