$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'), ]; } }