Skip to content

Commit 02b20a6

Browse files
committed
use temp urls
1 parent e8bb684 commit 02b20a6

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

demo/config/filesystems.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
'local' => [
3434
'driver' => 'local',
3535
'root' => storage_path('app'),
36+
'serve' => true,
3637
],
3738

3839
'public' => [

src/Form/Eloquent/Uploads/SharpUploadModel.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,6 @@ public function thumbnail(?int $width = null, ?int $height = null, array $modifi
9090

9191
public function playablePreviewUrl(): string
9292
{
93-
$path = $this->file_name;
94-
$thumbnailDisk = Storage::disk(sharp()->config()->get('uploads.thumbnails_disk'));
95-
96-
if (! $thumbnailDisk->exists($this->file_name)) {
97-
if (Storage::disk($this->disk)->exists($path)) {
98-
Storage::disk('public')->writeStream($path, Storage::disk($this->disk)->readStream($path));
99-
}
100-
}
101-
102-
return $thumbnailDisk->url($path);
93+
return Storage::disk($this->disk)->temporaryUrl($this->file_name, now()->addMinutes(30));
10394
}
10495
}

0 commit comments

Comments
 (0)