<?php
namespace App\Models;
use App\Constants\Util;

class Banner extends BaseModel
{
    protected $table = 'banner';
    protected $fillable = ['title', 'image', 'link' ,'type' ,'sort' ,'cny_rate','lang' ];
    
    protected function getImageAttribute($value)
    {
        return Util::ensureUrl($value);
    }

    protected function setImageAttribute($value)
    {
        $this->attributes['image'] = Util::replacePartInUrl($value);
    }
}
