<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Bank extends Model {
    //  protected $guarded=['Bank_Id'];
    //  protected $primaryKey = 'Bank_Id';
    // protected $casts=['is_active'=>'boolean'];
    // public function bankAccounts(){return $this->hasMany(BankAccount::class);}
    // public function chequeFormats(){return $this->hasMany(ChequeFormat::class);}


      protected $table = 'banks';

    protected $primaryKey = 'Bank_Id';

        protected $fillable = [
        'bank_code',
        'bank_name',
        'short_name',
        'ifsc_prefix',
        'logo',
        'is_active'
    ];

    protected $casts = [
        'is_active' => 'boolean'
    ];

    public function bankAccounts()
    {
        return $this->hasMany(BankAccount::class, 'Bank_Id', 'Bank_Id');
    }

    public function chequeFormats()
    {
        return $this->hasMany(ChequeFormat::class, 'Bank_Id', 'Bank_Id');
    }
}
