<?php
namespace App\Jobs;
use App\Models\OutboxMessage; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Event;
final class ProcessOutboxMessageJob implements ShouldQueue { use Dispatchable,InteractsWithQueue,Queueable,SerializesModels; public function __construct(public int $messageId){} public function handle(): void { $m=OutboxMessage::findOrFail($this->messageId); Event::dispatch($m->event_type,[$m->payload]); } }
