<?php
namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class Bank
 *
 * @package App
 * @property string $name
 * @property string $image
 * @property string $email
 * @property double $bank_interest
 * @property string $first_installment
 * @property string $loan_term
 * @method static bool|null forceDelete()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Bank newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Bank newQuery()
 * @method static \Illuminate\Database\Query\Builder|\App\Bank onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Bank query()
 * @method static bool|null restore()
 * @method static \Illuminate\Database\Query\Builder|\App\Bank withTrashed()
 * @method static \Illuminate\Database\Query\Builder|\App\Bank withoutTrashed()
 * @mixin \Eloquent
 */
class Bank extends Model
{
    const PAGINATE = 20;

    use SoftDeletes;

    protected $fillable = ['name', 'image', 'email', 'bank_interest', 'first_installment', 'loan_term'];
    protected $hidden = [];
    
    

    /**
     * Set attribute to date format
     * @param $input
     */
    public function setBankInterestAttribute($input)
    {
        if ($input != '') {
            $this->attributes['bank_interest'] = $input;
        } else {
            $this->attributes['bank_interest'] = null;
        }
    }
    
}
