<?php

namespace App\Casts;

use Illuminate\Contracts\Database\Eloquent\CastsAttributes;

class DefaultAvatar implements CastsAttributes
{
    public function get($model, string $key, $value, array $attributes)
    {
        return $value
            ?: 'https://fourtiao.oss-cn-beijing.aliyuncs.com/zhangsiye/images/6b40343b27263be34cf3212bf44f74c3.png';
    }

    public function set($model, string $key, $value, array $attributes)
    {
        return $value;
    }
}
