diff --git a/src/Actions/Blogs/StoreBlogCoverAction.php b/src/Actions/Blogs/StoreBlogCoverAction.php index 035e469..babeb1c 100644 --- a/src/Actions/Blogs/StoreBlogCoverAction.php +++ b/src/Actions/Blogs/StoreBlogCoverAction.php @@ -14,7 +14,9 @@ public function __invoke(UploadedFile $file, int $blogId, string $path = '/cover $structure = app()->environment('testing') || app()->environment('local') ? config('blog-crud.bucket_paths.local') : config('blog-crud.bucket_paths.production'); - $path = $structure . 'blogs/' . $blogId . '/cover-image.' . $file->getClientOriginalExtension(); + $filename = uniqid() . '_' . $file->getClientOriginalName(); + + $path = $structure . 'blogs/' . $blogId . '/cover-images/' . $filename; Storage::disk('s3')->put($path, $newFile);