Skip to content

Commit

Permalink
adjust how cover image storage works
Browse files Browse the repository at this point in the history
  • Loading branch information
SethSharp committed Apr 7, 2024
1 parent ee6af9c commit 07bfbb3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Actions/Blogs/StoreBlogCoverAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 07bfbb3

Please sign in to comment.