Skip to content

Commit f8462e3

Browse files
committed
Fix: duplicate "path" for Image/File FieldType
1 parent 0aa6cd8 commit f8462e3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Fields/Dtos/FileDto.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ class FileDto extends BaseDto
2020
/**
2121
* @var ?string
2222
*/
23-
public $directory;
23+
protected $directory;
2424

2525
public function getFullPath()
2626
{
27-
return $this->directory ? $this->directory . '/' . $this->path : $this->path;
27+
$fs = filled($this->disk) ? Storage::disk($this->disk) : Storage::getDriver();
28+
return $fs->path($this->path);
2829
}
2930

3031
public function getUrl(): ?string
3132
{
3233
$fs = filled($this->disk) ? Storage::disk($this->disk) : Storage::getDriver();
33-
34-
return $fs->url($this->getFullPath());
34+
return $fs->url($this->path);
3535
}
3636

3737
public function __toString()

0 commit comments

Comments
 (0)