<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class SupplierAccount extends Model
{
    protected $table = 'suppiler_account'; // correct typo in table name

    protected $fillable = [
        'supplier_id', 'grn_no', 'paid_amount', 'due_amount'
    ];

    public function supplier()
    {
        return $this->belongsTo(suppliers::class);
    }

    public function purchase()
    {
        return $this->belongsTo(Purchase::class, 'grn_no', 'grn_no');
    }
}
