*/ public function toArray(Request $request = null): array { $lists = []; foreach ($this->resource['response'] as $v) { $lists[] = [ 'fee_date' => $v['feeDate'], 'item_id' => $v['itemNo'], 'item_code' => $v['projectNumber'], 'item_name' => $v['entryName'], 'price' => (float) $v['unitPrice'], 'quantity' => $v['quantity'], 'unit' => $v['company'], 'spec' => $v['projectSpecifications'], 'total_price' => $v['money'], 'prescription_id' => $v['prescriptionNumber'], 'prescription_type' => $v['prescriptionType'], 'dept_id' => $v['treatmentDepartment'], 'dept_name' => $v['departmentName'], 'doctor_id' => $v['doctorNumber'], 'doctor_name' => $v['doctorName'], ]; } return $lists; } }