public function formatAttribute($attributes = [])
{
$attributes = $attributes ?: $this->attributes;
if ($this->hasFile()) {
$attributes['enctype'] = 'multipart/form-data';
}
$html = [];
foreach ($attributes as $key => $val) {
$html[] = "{$key}=\"{$val}\"";
}
return implode(' ', $html) ?: '';
}