<?php
namespace App\Application\Services;
use App\Models\OutboxMessage; use Illuminate\Support\Str;
final class OutboxService { public function record(string $aggregateType,string $aggregateId,string $eventType,array $payload,string $queue='default'): OutboxMessage { return OutboxMessage::create(['public_id'=>(string)Str::ulid(),'aggregate_type'=>$aggregateType,'aggregate_id'=>$aggregateId,'event_type'=>$eventType,'payload'=>$payload,'queue'=>$queue,'available_at'=>now()]); } }
