'Menunggu Pembayaran', 1 => 'Pembayaran Terkonfirmasi', // Pembayaran Diterima 2 => 'Ditolak', 3 => 'Dibatalkan', // Canceled 4 => 'Expired', ]; public $sPaymentMethodName = [ 1 => 'Pribadi', 2 => 'On-Site Payment', 3 => 'OVO', 4 => 'Asuransi', 5 => 'Voucher', ]; public $nIDJenisBookingNames = [ 1 => 'Rawat Jalan', 2 => 'Telekonsultasi', 3 => 'Chat Sekarang' ]; protected $connection = 'oldlms'; protected $table = 'tx_appointment'; protected $primaryKey = 'nID'; public $incrementing = false; protected $keyType = 'string'; protected $fillable = [ 'nID', 'nIDDokter', 'nIDUser', 'sStatus', 'dCreateOn', 'dUpdateOn', 'dDeleteOn', ]; protected $appends = [ 'status_name', 'payment_method', 'type' ]; protected function statusName(): Attribute { return Attribute::make( get: function ($value) { return $this->sStatusNames[$this->sStatus] ?? '-'; }, ); } protected function paymentMethod(): Attribute { return Attribute::make( get: function ($value) { return $this->sPaymentMethodName[$this->sPaymentMethod] ?? '-'; }, ); } protected function type(): Attribute { return Attribute::make( get: function($value) { return $this->nIDJenisBookingNames[$this->nIDJenisBooking] ?? '-'; } ); } public function appointmentDetail() { return $this->hasOne(AppointmentDetail::class, 'nIDAppointment', 'nID'); } public function doctor() { return $this->belongsTo(Dokter::class, 'nIDDokter', 'nID'); } public function user() { return $this->belongsTo(User::class, 'nIDUser', 'nID'); } public function healthCare() { return $this->belongsTo(Healthcare::class, 'nIDHealthCare', 'nID'); } }