<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class PayBillDetails extends Model
{
    protected $table = 'pay_bill_details';

    protected $fillable = [
        'pay_bill_id',
        'bill_id',
        'amount',
    ];

    protected $casts = [
        'amount' => 'decimal:2',
    ];

    public function payBill(): BelongsTo
    {
        return $this->belongsTo(PayBill::class, 'pay_bill_id');
    }

    public function bill(): BelongsTo
    {
        return $this->belongsTo(Bill::class, 'bill_id');
    }
}
