Skip to content

Commit 07bfbb3

Browse files
committed
adjust how cover image storage works
1 parent ee6af9c commit 07bfbb3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Actions/Blogs/StoreBlogCoverAction.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ public function __invoke(UploadedFile $file, int $blogId, string $path = '/cover
1414
$structure = app()->environment('testing') || app()->environment('local')
1515
? config('blog-crud.bucket_paths.local') : config('blog-crud.bucket_paths.production');
1616

17-
$path = $structure . 'blogs/' . $blogId . '/cover-image.' . $file->getClientOriginalExtension();
17+
$filename = uniqid() . '_' . $file->getClientOriginalName();
18+
19+
$path = $structure . 'blogs/' . $blogId . '/cover-images/' . $filename;
1820

1921
Storage::disk('s3')->put($path, $newFile);
2022

0 commit comments

Comments
 (0)