symfony/remote-event
Symfony RemoteEvent component helps you receive and handle remote events from third-party services. It provides a structured way to parse payloads, validate signatures, and dispatch events within your application for consistent, secure integrations.
HttpFoundation, Messenger, DependencyInjection) introduces misalignment with Laravel’s native systems (Illuminate\Events, Bus, Queue). However, its security-first approach (HMAC validation, schema enforcement) and immutable DTOs are valuable for Laravel applications handling high-stakes webhooks (e.g., payments, SaaS integrations).Bus/Queue via custom adapters (e.g., wrapping Symfony’s RemoteEventDispatcher in a Laravel facade).Monolog) and error-handling systems.Container clashes with Laravel’s ServiceProvider/Binding system, requiring a custom bridge.HttpFoundation is incompatible with Laravel’s Illuminate\Http; a request parser adapter is needed.Messenger (async processing) would need a Laravel Queue adapter (e.g., SymfonyMessengerQueueAdapter).RemoteEventDispatcher → Laravel Event/Bus system.HttpFoundation → Illuminate\Http\Request.Messenger → Laravel Queue (e.g., Illuminate\Bus\Queueable).symfony/http-foundation, symfony/messenger), which may conflict with Laravel’s ecosystem or increase bundle size.#[RemoteEvent]) could slow adoption.LaravelRemoteEvent) to hide Symfony complexities.symfony/* packages without full Symfony framework.spatie/laravel-webhook-client).spatie/laravel-webhook-client: Simpler, but lacks Symfony’s validation depth.fruitcake/laravel-webhooks: More feature-rich, but still Laravel-centric.Messenger for async processing)?HttpFoundation vs. Laravel’s Illuminate\Http.EventDispatcher vs. Laravel’s Illuminate\Events.Messenger vs. Laravel’s Bus/Queue.Container vs. Laravel’s ServiceProvider.symfony/http-client, symfony/messenger).Bus/Queue but need Symfony’s validation layer.spatie/laravel-webhook-client, fruitcake/laravel-webhooks).HttpFoundation → Illuminate\Http).RemoteEventDispatcher → Laravel Event/Bus).Queue for async processing (if using Symfony Messenger).LaravelRemoteEvent facade to wrap Symfony’s RemoteEventDispatcher.SymfonyRequestParser to convert Illuminate\Http\Request to HttpFoundation.SymfonyMessengerQueueAdapter to bridge Messenger and Laravel’s Bus.| Symfony Feature | Laravel Equivalent | Compatibility Notes |
|---|---|---|
HttpFoundation |
Illuminate\Http |
Requires custom parser (e.g., SymfonyRequestParser). |
EventDispatcher |
Illuminate\Events |
Can dispatch Laravel events via facade, but loses Symfony’s middleware pipeline. |
Messenger |
Illuminate\Bus\Queueable |
Needs adapter to route Symfony messages to Laravel queues. |
DependencyInjection |
Illuminate\Container |
Conflicts; use Symfony’s Container only for RemoteEvent components. |
#[RemoteEvent] Annotations |
Laravel’s #[Handle] (Laravel 9+) |
Can use Laravel’s annotations with custom logic, but loses Symfony’s validation hooks. |
| Signature Validation | Custom logic (e.g., hash_hmac) |
RemoteEvent’s built-in validation is superior; worth the adapter effort. |
RemoteEventValidator.RemoteEvent DTOs for immutable payloads (aligns with Laravel’s ShouldQueue DTOs).RemoteEventDispatcher in a Laravel facade to dispatch to Illuminate\Events.Bus via a custom Queueable interface.RemoteEvent objects.// app/Http/Middleware/RemoteEventMiddleware.php
public function handle(Request $request, Closure $next) {
$event = RemoteEventParser::fromRequest($request);
$dispatcher = app(LaravelRemoteEvent::class);
$dispatcher->dispatch($event);
return $next($request);
}
QueueAdapter to dispatch messages to Laravel’s Bus.// app/Providers/RemoteEventServiceProvider.php
public function boot() {
$messenger = new Messenger();
$queueAdapter = new SymfonyMessengerQueueAdapter($messenger);
Bus::queueUsing
How can I help you explore Laravel packages today?