*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'employee_id' => $this->employee_id, 'employee' => EmployeeResource::make($this->whenLoaded('employee')), 'store_id' => $this->store_id, 'store' => StoreResource::make($this->whenLoaded('store')), 'reimbursement_type_id' => $this->reimbursement_type_id, 'type' => KeywordResource::make($this->whenLoaded('type')), 'workflow_check' => WorkflowCheckResource::make($this->whenLoaded('workflow')), 'expense' => $this->expense, 'reason' => $this->reason, 'photos' => $this->photos, 'created_at' => $this->created_at?->getTimestamp(), 'created_format' => $this->created_at->format('Y-m-d H:i:s'), 'updated_at' => $this->updated_at?->getTimestamp(), ]; } }