<?php

namespace App;

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

class MerchantBankLogs extends Model
{

    use Encryptable;

    public static $encryptable = ['account_number'];

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

    protected $table = 'merchant_bank_logs';

    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');
    }

    public function user()
    {
        return $this->hasOne('App\User', 'id', 'user_id');
    }

}
