symfony/remote-event
Symfony RemoteEvent helps your app receive, validate, and handle remote events (like webhooks) in a consistent way. It provides tooling to parse payloads, verify signatures, map to event objects, and process them through Symfony’s event/HTTP workflows.
orders-service and inventory-service with typed OrderCreated/InventoryReserved remote events.PaymentProcessed event triggers both SendReceiptEmail and UpdateCustomerBalance asynchronously.eloquent events + Symfony’s RemoteEvent for audit trails).Adopt if:
Look elsewhere if:
spatie/laravel-webhooks, fruitcake/laravel-cqrs).For Executives: *"Symfony RemoteEvent lets us standardize how services communicate asynchronously, reducing coupling, improving reliability, and cutting development time for event-driven features. Here’s why it’s a game-changer for us:
orders-service gets 10x traffic, notifications-service isn’t blocked.For Engineering: *"This package gives us batteries-included event handling with zero reinvention:
Validator (compatible with Laravel’s spatie/laravel-validation).HttpClient or Laravel’s Guzzle) and add AMQP later.// App/Providers/RemoteEventServiceProvider.php
public function register() {
$this->app->singleton(RemoteEventInterface::class, function ($app) {
return new LaravelRemoteEvent($app->make(HttpClient::class));
});
}
Tradeoffs:
For Architects: *"Key advantages:
HttpClient or Laravel’s HttpClient) and add queues later.Validator integrates with Laravel’s Validator facade or spatie/laravel-validation for schema enforcement.Risks:
ContainerInterface requires a bridge (e.g., symfony/dependency-injection + Laravel’s Container). Mitigate with a decorator pattern or Laravel service provider.Event class lacks RemoteEventInterface. Solution: Create a LaravelRemoteEvent wrapper that implements both interfaces.dispatch() with onQueue.Mitigation:
RemoteEventTransport) to swap implementations later.Example Workflow:
/webhooks/stripe (Laravel route).RemoteEventListener (Symfony Messenger).PaymentProcessed event.EventServiceProvider handles the event (e.g., triggers UpdateInventory job).Tools to Complement:
failure_transport.symfony/messenger-test for event validation.justinrainbow/json-schema for payload validation."How can I help you explore Laravel packages today?