dlakomski/jms-serializer-bundle-bridge
Illuminate\Events) and message queues (e.g., laravel-queue, pusher-php-server) could theoretically leverage this via Symfony’s HttpKernel integration or standalone JMSSerializer usage. However, Laravel lacks native SimpleBus support, requiring indirect adoption (e.g., wrapping messages in a Symfony-like context).SimpleBus. Workarounds include:
SimpleBus) for Laravel’s native queues/events.Illuminate\Contracts\Bus\Dispatcher facade).HttpKernel, DependencyInjection), adding ~10MB+ to Laravel’s footprint.SimpleBus into Laravel’s ecosystem without custom glue code.serialize() or spatie/array-to-object as a backup.SimpleBus/JMSSerializer for security/CVE updates.json_encode() or spatie/laravel-data suffice?spatie/laravel-activitylog (for event serialization).nesbot/carbon + json for simpler cases.Laravel Compatibility:
dlakomski/jms-serializer-bundle or ocramius/proxy-manager).App\Services\SimpleBusDispatcher).| Component | Laravel Equivalent | Notes |
|---|---|---|
| SimpleBus | Illuminate\Bus\Dispatcher |
Custom facade/wrapper needed. |
| JMSSerializer | spatie/laravel-data (partial) |
Or standalone JMS. |
| AsynchronousBundle | laravel-queue + pusher-php |
Use queues for async processing. |
Symfony Dependencies:
HttpKernel (for SimpleBus integration). Can be polyfilled via:
composer require symfony/http-kernel symfony/dependency-injection
Phase 1: Serialization Only
// config/app.php
'serializer' => [
'default' => \JMS\Serializer\SerializerBuilder::create()->build(),
];
use JMS\Serializer\SerializerInterface;
class MyJob implements ShouldQueue {
public function handle(SerializerInterface $serializer) {
$data = $serializer->serialize($this, 'json');
// Store/transmit $data
}
}
Phase 2: SimpleBus Integration (Optional)
SimpleBus features are needed:
SimpleBus:
// app/Providers/SimpleBusServiceProvider.php
use SimpleBus\Asynchronous\SimpleBusAsynchronousBundle;
use Symfony\Component\HttpKernel\Kernel;
class SimpleBusServiceProvider extends ServiceProvider {
public function register() {
$kernel = new class extends Kernel {
public function getProjectDir() { return base_path(); }
public function getCacheDir() { return storage_path('framework/cache'); }
};
$bundle = new SimpleBusAsynchronousBundle();
$bundle->boot($kernel);
}
}
config/app.php:
'providers' => [
App\Providers\SimpleBusServiceProvider::class,
],
Phase 3: Bridge Integration
AppKernel):
# config/bundles.php
return [
SimpleBusJMSSerializerBundleBridgeBundle::class => ['all' => true],
];
serialize()).SimpleBus (requires custom work).spatie/laravel-data, json_encode(), or msgpack.AppKernel, bundles).spatie/laravel-data).SimpleBus/JMS.How can I help you explore Laravel packages today?