$this->nID, 'doctor_name' => isset($this->doctor->user->sFirstName) ? $this->doctor->user->sFirstName . ' ' . $this->doctor->user->sLastName : null, 'speciality' => $this->doctor->speciality->sKeterangan, 'date_appointment' => Carbon::parse($this->appointmentDetail->dTanggalAppointment)->format('d-m-Y') . ' ' . $this->appointmentDetail->tTimeAppointment, 'date_created' => Carbon::parse($this->dCreateOn)->format('d-m-Y H:i:s') ?? null, 'appointment_media' => $this->sMedia, 'status' => $this->status_name, 'health_care' => $this->healthCare->sHealthCare ?? null, 'payment_method' => $this->payment_method ?? null, ]; $payment_detail = null; if ($this->appointmentDetail->sPaymentDetails != null) { $payment_detail = [ 'payment_type' => $this->appointmentDetail->sPaymentDetails['payment_type'], 'transaction_time' => $this->appointmentDetail->sPaymentDetails['transaction_time'], 'gross_amount' => $this->appointmentDetail->sPaymentDetails['gross_amount'], 'currency' => $this->appointmentDetail->sPaymentDetails['currency'], 'status_message' => $this->appointmentDetail->sPaymentDetails['status_message'], ]; } $appointment['payment_detail'] = $payment_detail; return $appointment; } }