*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'kind' => $this->kind->value, 'status' => $this->status->value, 'call_id' => $this->call_id, 'subject' => $this->resource->subject(), 'name' => $this->name, 'email' => $this->email, 'organisation' => $this->organisation, 'message' => $this->message, 'hours_per_week' => $this->hours_per_week, 'links' => (object) ($this->links ?? []), 'locale' => $this->locale, 'notes' => $this->notes, 'handled_by' => $this->whenLoaded('handler', fn () => $this->handler ? [ 'id' => $this->handler->id, 'name' => $this->handler->name, ] : null), 'handled_at' => $this->handled_at?->toIso8601String(), 'created_at' => $this->created_at?->toIso8601String(), 'updated_at' => $this->updated_at?->toIso8601String(), 'deleted_at' => $this->deleted_at?->toIso8601String(), ]; } }