Skip to content

Commit 4a41e44

Browse files
WIP: file download
1 parent d696be5 commit 4a41e44

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Eloquent/Media.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public function thumbnail(int $width = null, int $height = null, bool $fit = fal
3535

3636
public function download(): ?string
3737
{
38-
return \Storage::disk($this->disk)->url($this->file_name);
38+
return app(Thumbnail::class)
39+
->forMedia($this)
40+
->download();
3941
}
4042
}

src/Support/Thumbnails/LocalThumbnail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,6 @@ private function generateThumbnail(string $sourceDisk, string $sourceRelPath, st
8888

8989
public function download(): ?string
9090
{
91-
return $this->mediaModel->download();
91+
return $this->storage->disk($this->mediaModel->disk)->url($this->mediaModel->file_name);
9292
}
9393
}

0 commit comments

Comments
 (0)