PaymentType::class, 'amount' => 'decimal:2', 'percentage' => 'decimal:2', 'due_date' => 'date', ]; public function template() { return $this->belongsTo(PaymentTemplate::class); } public function schedule() { return $this->belongsTo(PaymentSchedule::class); } public function payments() { return $this->hasMany(Payment::class, 'schedule_item_id'); } }