id; } public function requireId(): string { if (! $this->id) { throw new \RuntimeException('Customer creation returned an empty id.'); } return $this->id; } public function toArray(): array { return [ 'id' => $this->id, 'name' => $this->name, 'email' => $this->email, 'code' => $this->code, 'document' => $this->document, 'document_type' => $this->documentType, 'type' => $this->type, 'delinquent' => $this->delinquent, 'address' => $this->address?->toArray(), 'phones' => $this->phones->toArray(), 'created_at' => $this->createdAt, 'updated_at' => $this->updatedAt, ]; } }