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
Normalizer Extension Bundle

Normalizer Extension Bundle Laravel Package

richcongress/normalizer-extension-bundle

The RichCongress Normalizer Extension Bundle provides a Symfony integration for reusable normalizer extensions, making it easier to customize object normalization and keep serialization logic organized across your PHP applications, with a lightweight way to extend existing normalizers.

View on GitHub
Deep Wiki
Context7

This bundle provides some handy tools and configuration for the Symfony Serializer.

Frequently asked questions about Normalizer Extension Bundle
What does richcongress/normalizer-extension-bundle do?
It is a Symfony bundle that adds reusable normalizers and denormalizers on top of Symfony's Serializer component. It decorates the existing serializer service so normalize() and denormalize() calls can handle nested objects, typed collections, and constructor-based hydration. You do not need to write custom normalizer classes for those common cases.
Is richcongress/normalizer-extension-bundle compatible with Laravel?
No, it is a Symfony bundle registered through Symfony's bundle system and built around Symfony's Serializer service. Laravel uses its own service container and does not load Symfony bundles in the same way, so you should not expect this package to work as a drop-in Laravel dependency. Laravel developers evaluating it should look for Laravel-specific serialization packages or adapt the underlying normalizers manually.
How do I install richcongress/normalizer-extension-bundle?
Install it with Composer using composer require richcongress/normalizer-extension-bundle. Then enable the bundle in your Symfony application's bundle configuration, typically in config/bundles.php. The bundle uses autoconfiguration, so you should not need to wire the serializer decoration manually.
Does this bundle replace Symfony's serializer service?
No, it decorates the existing serializer service rather than replacing it. Existing normalize() and denormalize() calls keep working while gaining smarter handling for nested objects and typed collections. That decoration approach makes it a drop-in extension for projects already using Symfony's Serializer.
Does it support nested objects and typed collections?
Yes, the package is designed to improve handling of nested objects and typed collections during normalization and denormalization. It also supports constructor-based hydration, which helps when your objects expect dependencies or required values through the constructor. These behaviors are applied through the decorated serializer service.
How do I configure normalizer priority and serialization context?
The bundle exposes configurable priority and serialization context, so you can tune how normalizers participate in the serializer chain. Configuration is handled through the bundle's Symfony integration rather than by editing the serializer service directly. Check the package README for the exact configuration keys and defaults.
Does it work with PHP 8 attributes and Doctrine entities?
Yes, the overview states that it works with PHP 8 attributes and Doctrine entities. That makes it suitable for projects that use attribute-based serialization metadata alongside Doctrine-managed models. You should still test your specific entity mappings and attribute groups against the normalizers.
Which Symfony and PHP versions are supported?
The provided package description does not list exact Symfony or PHP version constraints. Check the composer.json on the repository and the package's release notes before installing, especially if you are on an older Symfony LTS or a newer PHP minor. The bundle is Symfony-specific and expects the framework's bundle system.
How do I test normalization and denormalization with this bundle?
Write integration tests that boot a Symfony kernel with the bundle enabled and call the serializer service on representative DTOs, nested objects, and typed collections. Assert both the normalized array output and the denormalized object graph, including constructor-based hydration. Unit tests can also target individual normalizers, but the decoration behavior is best verified through the container.
What are alternatives to this bundle for Laravel or Symfony?
For Symfony projects, the built-in Serializer component plus custom normalizers is the standard alternative, and API Platform provides broader serialization features. For Laravel projects, this Symfony bundle is not a direct fit, so look at Laravel-specific packages or framework features such as API resources and custom casts. Evaluate alternatives against your need for nested objects, typed collections, and constructor hydration.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource