Initial commit - Physiotherapy Clinic Management System
This commit is contained in:
commit
dbb326f2cc
300 files changed
+144285
No files matched your search
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class PaymentResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $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'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user