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
Serialization Group Bundle

Serialization Group Bundle Laravel Package

gl3n/serialization-group-bundle

A Symfony bundle that simplifies serialization groups, letting you control which object properties are exposed in different contexts. Define groups once and reuse them across API responses and other serialized output.

View on GitHub
Deep Wiki
Context7

Serialization Group Bundle is a Symfony bundle for organizing and managing serialization groups used by the Symfony Serializer. It helps keep group definitions structured and reusable across entities and DTOs, reducing repetitive annotations and making API payloads easier to maintain.

  • Centralized, reusable serialization group definitions
  • Integrates with Symfony Serializer and dependency injection
  • Reduces duplication across entities and DTOs
  • Helps keep API responses consistent
  • Lightweight setup for existing Symfony applications
Frequently asked questions about Serialization Group Bundle
Can I use gl3n/serialization-group-bundle in Laravel?
No. It is a Symfony bundle with no Laravel service provider, and Laravel has no bundle registration mechanism. The package depends on Symfony container and serializer metadata wiring that does not survive in a Laravel service provider. Treat any integration attempt as a rewrite rather than an install.
What does gl3n/serialization-group-bundle actually do?
It organizes Symfony Serializer serialization groups through configuration rather than per-property annotations. You map classes to groups per serialization context, and the bundle applies them automatically to entities and DTOs. Its value is reducing annotation boilerplate and keeping group logic in one config file.
How do I install gl3n/serialization-group-bundle?
In a Symfony application you would install it with Composer and register the bundle in the kernel, then define class-to-group mappings in configuration. In Laravel, expect Composer dependency resolution to fail or require significant overrides because the package targets Symfony 2.x and 3.x APIs. Always test the require in a throwaway branch before planning around it.
Is gl3n/serialization-group-bundle compatible with Laravel 10 or 11?
No. Laravel 10 and 11 pull Symfony 6.4 or 7 components, while this bundle dates from the Symfony 2.x and 3.x era. Its bundle extension conventions and metadata loader signatures were deprecated in Symfony 3 and removed in Symfony 4. Composer conflicts are likely at install time, not just during upgrades.
What are alternatives to serialization groups in Laravel?
Laravel API Resources with conditional attributes such as when, whenHas, and whenLoaded cover most context-dependent field exposure needs natively. If you need config-driven groups, JMS Serializer can run standalone in Laravel and supports YAML or XML mapping. A custom Symfony Serializer metadata factory decorator is another option for non-Eloquent DTOs.
How do I configure serialization groups per context without annotations?
In Symfony this bundle lets you declare class-to-group mappings in configuration for each context. In Laravel you can implement a small config-driven mapper, roughly 50 to 150 lines, that resolves groups per class and context. If you need runtime role selection such as admin versus public, add explicit context resolution in your own code.
Does gl3n/serialization-group-bundle work with PHP 8.2?
Almost certainly not without changes. The last release was in 2016, so expect no PHP 8 attributes, typed properties, union types, or readonly support. Static analysis against a modern baseline will produce noise, and Composer constraints may block installation entirely. Verify with an actual composer require in an isolated branch.
Is gl3n/serialization-group-bundle maintained?
There is no evidence of active maintenance. The last release was 2016-03-08, the repository has about four stars and zero dependents, and no tests are visible to justify confidence. Treat it as an abandoned experiment and clarify who would own a fork and handle vulnerability disclosures before adopting it.
How should I test serialization groups in a Laravel application?
Use Laravel API Resources and feature tests that assert the exact JSON structure for each endpoint and role. If you build a config-driven group mapper, add unit tests for class-to-group resolution and context selection. Test admin, public, and internal contexts explicitly so conditional fields do not leak.
What is the migration path from gl3n/serialization-group-bundle to Laravel?
Migrate the concept, not the code. Start by replacing per-class group declarations with Laravel API Resources and conditional attributes, which retires the need for most teams. If you still need configuration-driven groups, use JMS Serializer standalone with a ServiceProvider metadata loader or a Symfony Serializer metadata factory decorator. Budget for the original package failing to install.
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.
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
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager