$orderIds */ public function __construct( public readonly array $orderIds, public readonly int $userId, ) {} public function handle(ExportProductionOrdersService $service): void { try { $file = $service->handle($this->orderIds, $this->userId); event(new SendWebSocketMessageEvent( 'Экспорт графика заказов завершён!', $this->userId, ['link' => $file->link], )); } catch (Throwable $exception) { Log::error('Production orders export failed.', [ 'user_id' => $this->userId, 'orders_count' => count($this->orderIds), 'error' => $exception->getMessage(), ]); event(new SendWebSocketMessageEvent( 'Ошибка экспорта графика заказов: '.$exception->getMessage(), $this->userId, ['error' => $exception->getMessage()], )); throw $exception; } } }