lastTransaction; } public function toArray(): array { return array_filter([ 'id' => $this->id, 'status' => $this->status, 'amount' => $this->amount, 'currency' => $this->currency, 'paid_at' => $this->paidAt, 'created_at' => $this->createdAt, 'last_transaction' => $this->lastTransaction?->toArray(), ], static fn ($v) => $v !== null); } }