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
Serializer Bundle

Serializer Bundle Laravel Package

happyr/serializer-bundle

Symfony bundle that integrates HappyR's serializer, wiring services and configuration so you can convert PHP objects to JSON and back with less boilerplate. Useful for APIs and apps that need consistent, configurable object serialization.

View on GitHub
Deep Wiki
Context7

An easy serializer bundle built on top of Symfony Serializer compnent

Frequently asked questions about Serializer Bundle
Can I use happyr/serializer-bundle in a Laravel application?
No, not as shipped. It is a Symfony bundle registered through Symfony's Kernel and DI extension mechanism, and Laravel has no bundle loader, so its main value (automatic serializer service wiring plus YAML/XML/annotation configuration) is not consumable without rewriting it as a Laravel service provider. If you only need the serialization behaviour, install the standalone symfony/serializer component instead.
Does happyr/serializer-bundle support Laravel 10 or 11?
No. Its last release was in July 2016 and it constrains Symfony components to ^2.x|^3.0 with PHP >=5.5, so Composer will usually refuse to resolve it alongside Laravel 10/11 and their Symfony 6/7 dependencies. Even where resolution succeeds you would be locked to a deeply outdated serializer version.
Is happyr/serializer-bundle still maintained?
No. There has been no release since 2016-07-14 and no commits addressing PHP 7.4/8.x or Symfony 4, 5, 6 and 7 compatibility. Packagist shows zero dependents, meaning there is no downstream ecosystem pressure to keep it patched and little real-world usage evidence to draw on. It should be treated as abandoned.
What should I use instead of happyr/serializer-bundle in Laravel?
For most Laravel apps the built-in stack is enough: Eloquent toArray/toJson, API Resources (JsonResource and ResourceCollection) and JsonResponse. If you need attribute-driven DTO mapping, spatie/laravel-data is the closest Laravel-native analogue to what this bundle attempted in Symfony. If you specifically need Symfony Serializer's normalizers, denormalizers and discriminator maps, install symfony/serializer directly and bind it in a service provider.
How do I install happyr/serializer-bundle?
In a Symfony project you would run composer require happyr/serializer-bundle and register the bundle in your kernel or bundles.php, which exposes the serializer service in the container. In Laravel there is no equivalent bundle registration step, so installation alone gives you no working serializer service. Adding it to a Laravel composer.json is not recommended because of the constraint conflicts described above.
Can I use Symfony Serializer in Laravel without this bundle?
Yes. Install symfony/serializer together with symfony/property-access and symfony/property-info, then bind a configured Serializer instance as a singleton in a Laravel service provider. The component is standalone and does not require the bundle, so you keep the normalizer pipeline without the dead DI wrapper. This is the only part of the bundle's functionality that is genuinely portable.
Does happyr/serializer-bundle work with PHP 8 attributes?
No. The bundle predates PHP 8 attributes and relies on @Serializer annotations, which are deprecated in modern Symfony Serializer in favour of attributes. Any port would require converting annotation mappings to attributes or to array/YAML mappings consumed by the standalone component.
Is happyr/serializer-bundle safe to run in production?
It is a significant risk. An abandoned dependency that pulls an old Serializer release inherits every security fix made in that component since 2016, and there is no maintainer to patch future issues. Because it has zero dependents and shows no community evidence of production use, most teams would need an explicit policy exception to adopt it.
How do I migrate a Symfony app using happyr/serializer-bundle to Laravel?
Start by enumerating every class that uses @Serializer annotations or injects the serializer service alias. Replace container injections with a Laravel singleton binding for Serializer, convert annotation mappings to PHP 8 attributes or array/YAML mappings, and move config/packages/serializer.yml into a config/serializer.php file backed by a thin factory. Finally remove the bundle dependency.
Will happyr/serializer-bundle conflict with Laravel's own serialization?
Yes. It introduces a second normalization pipeline running alongside Laravel's JsonResource and JsonResponse stack, and two competing abstractions are a common source of subtle output drift between endpoints. That duplication is a maintenance hazard even if the package installed cleanly, which it generally will not.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections