Weave Code
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
Jms Serializer Bundle Bridge

Jms Serializer Bundle Bridge Laravel Package

simple-bus/jms-serializer-bundle-bridge

Symfony bundle that wires SimpleBus’s JMS Serializer ObjectSerializer as the default object serializer for SimpleBus AsynchronousBundle. Enable SimpleBusJMSSerializerBundleBridgeBundle in your AppKernel to use it.

View on GitHub
Deep Wiki
Context7

[READ ONLY] Symfony bundle for using JMSSerializer as message serializer for SimpleBus/Asynchronous

Frequently asked questions about Jms Serializer Bundle Bridge
Can I use this package directly in Laravel, or is it strictly for Symfony?
This package is designed for Symfony and relies on `AppKernel`, which Laravel doesn’t use. However, its core functionality (JMSSerializer integration) can be adapted for Laravel via a custom wrapper package. You’d need to extract the serialization logic and repackage it as a Laravel service provider or standalone package.
How do I install this in a Laravel project if it’s Symfony-focused?
You can’t install it directly in Laravel. Instead, create a Laravel-compatible package that depends on `simple-bus/jms-serializer-bridge` and provides Laravel-specific integration (e.g., a service provider). Alternatively, use the underlying `jms/serializer-bundle` or `simple-bus/jms-serializer-bridge` directly in a custom implementation.
What Laravel versions does this package support, or do I need a wrapper?
This package doesn’t natively support Laravel. However, its dependencies (JMSSerializer) work with PHP 8.0+, which aligns with Laravel 8+. A wrapper package would need to handle Laravel’s service container, queue workers, and event systems while leveraging the same serialization logic.
Will this work with Laravel Queues (Redis, database, etc.) or only SimpleBus?
The bridge is designed for SimpleBus/AsynchronousBundle, not Laravel’s native queues. To use it with Laravel Queues, you’d need to create adapters or middleware that translate between Laravel’s job payloads and SimpleBus messages. The serialization logic itself is agnostic to the queue system.
Are there performance concerns using JMSSerializer over Laravel’s native JSON serialization?
JMSSerializer offers advanced features (e.g., circular references, custom metadata) but may introduce slight overhead. Benchmark it against `json_encode()` for your use case. For high-throughput queues, consider caching serialized classes or using a hybrid approach (fallback to JSON for simple payloads).
How do I handle circular references or complex objects in Laravel with this package?
JMSSerializer excels at handling circular references and complex objects via annotations (e.g., `@MaxDepth`, `@ExclusionPolicy`). In Laravel, you’d configure these in your wrapper package’s service provider. For Eloquent models, ensure your wrapper respects Laravel’s visibility rules (e.g., `$hidden`, `$visible` attributes).
Can I use this for Laravel Events or just queues?
The package’s core purpose is for SimpleBus messaging, but its serialization logic can extend to Laravel Events. You’d need to create a Laravel event listener or dispatcher wrapper that uses JMSSerializer for payloads. This is useful for complex DTOs or nested event data.
What are the alternatives to this package for Laravel serialization?
For Laravel, consider `spatie/laravel-data` (for DTOs), `nesbot/carbon` (for dates), or custom JSON strategies with `json_encode()`/`json_decode()`. If you need advanced features like JMSSerializer, explore `spatie/fractal` or build a lightweight wrapper around `jms/serializer` without Symfony dependencies.
How do I debug serialization failures in Laravel with this package?
Since this isn’t natively Laravel-compatible, add custom logging in your wrapper package. Use `Log::debug()` to track serialization/deserialization steps. For queue jobs, log payloads before/after serialization to identify issues like circular references or missing metadata.
Who maintains this package, and how are updates handled?
This package is maintained by the SimpleBus team (Symfony-focused). For Laravel, you’d need to maintain a separate wrapper package. Plan for manual updates to handle changes in JMSSerializer or SimpleBus, or use semantic versioning to pin dependencies strictly.
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky