适配路径支持设置为空

This commit is contained in:
Wisp X
2022-04-01 16:20:23 +08:00
parent dec4e6fdb7
commit 798e72f634
2 changed files with 3 additions and 3 deletions
+2 -1
View File
@@ -164,7 +164,8 @@ class Image extends Model
public function pathname(): Attribute
{
return new Attribute(fn() => "{$this->path}/{$this->name}");
$path = $this->path ? "{$this->path}/" : '';
return new Attribute(fn() => "{$path}{$this->name}");
}
public function url(): Attribute