$this->id, 'payment_number' => $this->payment_number, 'invoice' => [ 'id' => $this->invoice->id, 'number' => $this->invoice->invoice_number, ], 'patient' => [ 'id' => $this->invoice->patient->id, 'name' => $this->invoice->patient->fullName(), ], 'payment_date' => $this->payment_date->format('Y-m-d'), 'amount' => $this->amount, 'payment_method' => $this->payment_method, 'reference_number' => $this->reference_number, 'notes' => $this->notes, 'received_by' => [ 'id' => $this->receivedBy->id, 'name' => $this->receivedBy->name, ], 'created_at' => $this->created_at?->format('Y-m-d H:i:s'), ]; } }