From 76b636351592ca42005986423864296701f7ea54 Mon Sep 17 00:00:00 2001 From: GP247 Date: Sun, 26 Oct 2025 21:44:52 +0700 Subject: [PATCH] Fix the issue custom domain for a public S3 bucket --- src/LfmStorageRepository.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/LfmStorageRepository.php b/src/LfmStorageRepository.php index 9753892d..69a28596 100644 --- a/src/LfmStorageRepository.php +++ b/src/LfmStorageRepository.php @@ -46,6 +46,12 @@ public function url($path) $config = $this->disk->getConfig(); if (key_exists('driver', $config) && $config['driver'] == 's3') { + // Check if custom URL is configured (for public bucket with custom domain) + if (!empty($config['url'])) { + return $this->disk->url($path); + } + + // Use temporary URL for private buckets without custom domain $duration = $this->helper->config('temporary_url_duration'); return $this->disk->temporaryUrl($path, now()->addMinutes($duration)); } else {