'integer', 'paid_amount' => 'integer', 'pos_ul' => 'integer', 'pos_ll' => 'integer', 'pos_ur' => 'integer', 'pos_lr' => 'integer', 'created_at' => JalaliDatetime::class, 'updated_at' => JalaliDatetime::class, ]; } public function getRemainedAmountAttribute(): int { return (int) ($this->treatment_cost ?? 0) - (int) ($this->paid_amount ?? 0); } public function patientRecord(): BelongsTo { return $this->belongsTo(Patient::class, 'patient'); } public function doctorRecord(): BelongsTo { return $this->belongsTo(Doctor::class, 'doctor'); } public function treatmentRecord(): BelongsTo { return $this->belongsTo(Treatment::class, 'treatment'); } public function paymentTypeRecord(): BelongsTo { return $this->belongsTo(PaymentType::class, 'payment_type'); } public function creator(): BelongsTo { return $this->belongsTo(User::class, 'created_by'); } public function updator(): BelongsTo { return $this->belongsTo(User::class, 'updated_by'); } }