diff --git a/app/Models/Brand.php b/app/Models/Brand.php index 010586f..4d00da6 100755 --- a/app/Models/Brand.php +++ b/app/Models/Brand.php @@ -63,10 +63,7 @@ class Brand extends Model { if (!empty($this->image)) { if (in_array(config('filesystems.default'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->image, - Date::now()->addMinutes(5) - ); + return Storage::url($this->image); }; return (string) '/' . $this->image; diff --git a/app/Models/Category.php b/app/Models/Category.php index 11f321d..1b98b7e 100755 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -148,10 +148,7 @@ class Category extends Model { if (!in_array($this->image, ['null', null])) { if (in_array(config('filesystems.default'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->image, - Date::now()->addMinutes(5) - ); + return Storage::url($this->image); } return config('app.url') . '/' . $this->image; diff --git a/app/Models/Post.php b/app/Models/Post.php index e409afb..4d3e374 100755 --- a/app/Models/Post.php +++ b/app/Models/Post.php @@ -56,13 +56,11 @@ class Post extends Model public function getImage(): string { if (!empty($this->image)) { - if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->image, Date::now()->addMinutes(5) - ); + if (in_array(config('filesystems.default'), ['s3', 'minio'])) { + return Storage::url($this->image); } - return $this->image; + return config('app.url') . '/' . $this->image; } return '/images/nophoto.jpg'; diff --git a/app/Models/Product.php b/app/Models/Product.php index 9b77613..4f1ca13 100755 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -237,10 +237,7 @@ class Product extends Model { if (!empty($this->poster)) { if (in_array(config('filesystems.default'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->poster, - Date::now()->addMinutes(5) - ); + return Storage::url($this->poster); } return config('app.url') . '/' . $this->poster; } @@ -252,10 +249,7 @@ class Product extends Model { if (!empty($this->data_sheet) and ($this->data_sheet != null and $this->data_sheet != "null")) { if (in_array(config('filesystems.default'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->data_sheet, - Date::now()->addMinutes(5) - ); + return Storage::url($this->data_sheet); } return config('app.url') . '/' . $this->data_sheet; } @@ -266,10 +260,7 @@ class Product extends Model { if (!empty($this->poster_thumb)) { if (in_array(config('filesystems.default'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->poster_thumb, - Date::now()->addMinutes(5) - ); + return Storage::url($this->poster_thumb); } return config('app.url') . '/' . $this->poster_thumb; } diff --git a/app/Models/Slider.php b/app/Models/Slider.php index f827841..e4de03a 100755 --- a/app/Models/Slider.php +++ b/app/Models/Slider.php @@ -45,12 +45,10 @@ class Slider extends Model public function getImage(): string { if (!empty($this->image)) { - if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->image, Date::now()->addMinutes(5) - ); + if (in_array(config('filesystems.default'), ['s3', 'minio'])) { + return Storage::url($this->image); } - return $this->image; + return config('app.url') . '/' . $this->image; } return '/images/nophoto.jpg'; diff --git a/config/filesystems.php b/config/filesystems.php index e33a624..fd8194d 100755 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -62,6 +62,7 @@ return [ 'region' => env('MINIO_REGION', 'us-east-1'), // Your MinIO region, typically 'us-east-1' 'bucket' => env('MINIO_BUCKET'), // The name of your bucket 'endpoint' => env('MINIO_ENDPOINT'), // MinIO server endpoint + 'url' => env('MINIO_URL'), // Public URL for the browser 'use_path_style_endpoint' => env('MINIO_USE_PATH_STYLE', true), // MinIO path-style support 'visibility' => 'public', // Set the visibility (public/private) 'signature_version' => 'v4', // Add this line