$this->id, 'claimId' => $this->claim_id, 'submissionDate' => $this->submission_date, 'histories' => $this->whenLoaded('histories'), 'fullName' => $this->whenLoaded('member', $this->member->full_name), 'status' => $this->status, 'files' => [ 'claimResults' => ClaimReportFileShowResources::collection($this->whenLoaded('claimResults')), 'claimConditions' => ClaimReportFileShowResources::collection($this->whenLoaded('claimConditions')), 'claimDiagnosis' => ClaimReportFileShowResources::collection($this->whenLoaded('claimDiagnosis')) ] ]; } }