*/ public function toArray(Request $request): array { return [ 'id' => $this->MedicalHistoryID, 'num' => $this->num, 'fullname' => Str::ucwords(Str::lower("$this->FAMILY $this->Name $this->OT")), 'age' => Carbon::parse($this->BD)->diff(Carbon::now())->format('%y'), 'birth_date' => Carbon::parse($this->BD)->format('d.m.Y'), ]; } }