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,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class LedgerEntryResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'entry_date' => $this->entry_date->format('Y-m-d'),
|
||||
'account' => [
|
||||
'id' => $this->chartOfAccount->id,
|
||||
'code' => $this->chartOfAccount->code,
|
||||
'name' => $this->chartOfAccount->name,
|
||||
'type' => $this->chartOfAccount->type,
|
||||
],
|
||||
'currency' => new CurrencyResource($this->currency),
|
||||
'amount' => $this->amount,
|
||||
'description' => $this->description,
|
||||
'source_type' => $this->source_type,
|
||||
'source_id' => $this->source_id,
|
||||
'created_by' => [
|
||||
'id' => $this->creator->id,
|
||||
'name' => $this->creator->name,
|
||||
],
|
||||
'created_at' => $this->created_at?->format('Y-m-d H:i:s'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user