<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Scopes\MessageScope;

class MerchantBank extends Model
{
    use Encryptable;

    protected $table = 'merchant_bank';

    public static $encryptable = ['account_number'];

    protected static function boot()
    {
        parent::boot();
        static::addGlobalScope(new MessageScope(static::$encryptable));
    }

    protected $fillable = ['merchant_id','bank_name','branch_name','account_number','ifsc_code','account_holder'];

    public function merchant()
    {
        return $this->hasOne('App\Merchant', 'id', 'merchant_id');
    }

}
