ecotone/jms-converter
Ecotone JMS Converter integrates JMS Serializer with Ecotone’s media type conversion, letting you serialize/deserialize commands, events, and query responses using JMS annotations (groups, naming, handlers) for JSON/XML. Works with Symfony, Laravel, or PSR-11.
@Groups to expose only public fields in API responses while hiding internal data.Adopt When:
@SerializedName, @Groups) in DTOs, models, or API responses.json_encode or Arrayable interfaces.Look Elsewhere If:
json_encode, spatie/fractal, or Laravel’s JsonSerializable).spatie/fractal or custom solutions).For Executives: "This package allows us to standardize how we serialize commands, events, and API responses using JMS annotations—a tool already familiar to our team—while integrating seamlessly with Laravel. It eliminates the need for custom serialization logic, reduces duplication, and ensures consistency when working with external systems or migrating to event-driven architectures. The low-risk adoption leverages existing tools (JMS Serializer) with minimal setup, and it future-proofs our architecture for scalable messaging patterns like CQRS."
For Engineers:
*"Ecotone’s JMS Converter lets us use @SerializedName, @Groups, and other JMS annotations directly on our DTOs for commands, events, and API responses. This is ideal if:
@Groups({"public"})).JsonSerializable or Arrayable implementations.
Works seamlessly with Laravel and scales from simple APIs to complex event sourcing. The tradeoff is a slight performance overhead, but it gains us maintainability and consistency. If we’re already using Ecotone for messaging, this is a natural fit; otherwise, it’s a lightweight way to adopt JMS annotations incrementally."*How can I help you explore Laravel packages today?