return a blank string when name attribute

This commit is contained in:
2023-04-17 13:54:37 +10:00
parent 2686a162e7
commit bec4b03a17

View File

@@ -206,8 +206,12 @@ class Media extends Model
*/ */
public function getUrlAttribute() public function getUrlAttribute()
{ {
$url = config("filesystems.disks.$this->storage.url"); if(isset($this->attributes['name'])) {
return "$url/$this->name"; $url = config("filesystems.disks.$this->storage.url");
return "$url/$this->name";
}
return '';
} }
/** /**