*/ public function toArray(Request $request): array { return [ 'uuid' => $this->uuid, 'title' => $this->title ?: $this->template?->title, 'source' => $this->source->value, 'source_label' => $this->source->label(), 'language' => $this->language, 'slide_count' => $this->slide_count, 'template' => $this->template ? [ 'title' => $this->template->title, 'slug' => $this->template->slug, ] : null, 'status' => $this->status->value, 'status_label' => $this->status->label(), 'error_message' => $this->error_message, 'download_url' => $this->output_path ? route('api.generations.download', $this->uuid) : null, 'created_at' => $this->created_at?->toIso8601String(), ]; } }