From 00f5287eea8305f2de419e6989067cef65587692 Mon Sep 17 00:00:00 2001 From: Dave Earley Date: Sun, 14 Jul 2024 09:59:40 -0700 Subject: [PATCH] Make public files public in object storage --- .../Services/Infrastructure/Image/ImageStorageService.php | 5 ++++- backend/config/filesystems.php | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/app/Services/Infrastructure/Image/ImageStorageService.php b/backend/app/Services/Infrastructure/Image/ImageStorageService.php index f03fdbf0..e8f59b86 100644 --- a/backend/app/Services/Infrastructure/Image/ImageStorageService.php +++ b/backend/app/Services/Infrastructure/Image/ImageStorageService.php @@ -31,7 +31,10 @@ public function store(UploadedFile $image, string $imageType): ImageStorageRespo $path = $this->filesystemManager->disk($disk)->putFileAs( path: strtolower($imageType), file: $image, - name: $filename + name: $filename, + options: [ + 'visibility' => 'public', + ], ); if ($path === false) { diff --git a/backend/config/filesystems.php b/backend/config/filesystems.php index 50b1a4a1..13a7d7ec 100644 --- a/backend/config/filesystems.php +++ b/backend/config/filesystems.php @@ -55,6 +55,7 @@ 'endpoint' => env('AWS_ENDPOINT'), 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 'throw' => false, + 'visibility' => 'public', ], 's3-private' => [ 'driver' => 's3',