From 2ba5677c45b660b250c840a4c2d9890845b0cc47 Mon Sep 17 00:00:00 2001 From: husanjon Date: Thu, 16 Apr 2026 04:05:10 +0500 Subject: [PATCH] test --- .env.example | 6 ++++++ .../Dashboard/Product/Controller.php | 5 +---- app/Models/Brand.php | 5 +---- app/Models/Category.php | 5 +---- app/Models/ContractTemplate.php | 5 +---- app/Models/File.php | 8 ++------ app/Models/OrderContract.php | 5 +---- app/Models/Partner.php | 5 +---- app/Models/PaymentSystemItem.php | 5 +---- app/Models/Post.php | 5 +---- app/Models/Product.php | 15 +++------------ app/Models/Screen.php | 10 ++-------- app/Models/Service.php | 5 +---- app/Models/Slider.php | 5 +---- app/Models/SpecialOffer.php | 4 +--- app/Models/UsefulInfo.php | 4 +--- app/Models/UsefulInfoItem.php | 5 +---- config/filesystems.php | 17 +++++++++-------- 18 files changed, 35 insertions(+), 84 deletions(-) diff --git a/.env.example b/.env.example index 79955a0..fa85e4c 100755 --- a/.env.example +++ b/.env.example @@ -64,6 +64,12 @@ AWS_DEFAULT_REGION=us-east-1 AWS_BUCKET= AWS_USE_PATH_STYLE_ENDPOINT=false +MINIO_ACCESS_KEY=admin +MINIO_SECRET_KEY=password +MINIO_BUCKET=quyoshli +MINIO_ENDPOINT=http://minio:9100 +MINIO_PUBLIC_URL=http://your-server:9100 + VITE_APP_NAME="${APP_NAME}" FORCE_HTTPS=true diff --git a/app/Http/Controllers/Dashboard/Product/Controller.php b/app/Http/Controllers/Dashboard/Product/Controller.php index 11c08c0..b2d05e1 100755 --- a/app/Http/Controllers/Dashboard/Product/Controller.php +++ b/app/Http/Controllers/Dashboard/Product/Controller.php @@ -284,10 +284,7 @@ class Controller extends ExController foreach ($children->screens as $screen) { $screen->sizeText = $screen->size / 1024 . 'Kb'; if (env('FILESYSTEM_DISK') == 's3') { - $screen->url = Storage::temporaryUrl( - $screen->path, - Date::now()->addMinutes(5) - ); + $screen->url = Storage::url($screen->path); } else { $screen->url = '/' . $screen->path; } diff --git a/app/Models/Brand.php b/app/Models/Brand.php index d173a09..f8a8811 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); } ; diff --git a/app/Models/Category.php b/app/Models/Category.php index 4be5934..f66d0f8 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/ContractTemplate.php b/app/Models/ContractTemplate.php index 22e123a..e2290fa 100755 --- a/app/Models/ContractTemplate.php +++ b/app/Models/ContractTemplate.php @@ -31,10 +31,7 @@ class ContractTemplate extends Model { if (!empty($this->path)) { if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->path, - Date::now()->addMinutes(5) - ); + return Storage::url($this->path); } return '/' . $this->path; } diff --git a/app/Models/File.php b/app/Models/File.php index 001860c..5bffd50 100755 --- a/app/Models/File.php +++ b/app/Models/File.php @@ -48,9 +48,7 @@ class File extends Model { if (!empty($this->path)) { if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->path, Date::now()->addMinutes(5) - ); + return Storage::url($this->path); } return (string) $this->path; } @@ -65,9 +63,7 @@ class File extends Model { if (!empty($this->path_thumb)) { if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->path_thumb, Date::now()->addMinutes(5) - ); + return Storage::url($this->path_thumb); } return (string) $this->path_thumb; } diff --git a/app/Models/OrderContract.php b/app/Models/OrderContract.php index ba87c63..096c7c0 100755 --- a/app/Models/OrderContract.php +++ b/app/Models/OrderContract.php @@ -37,10 +37,7 @@ class OrderContract extends Model { if (!empty($this->path)) { if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->path, - Date::now()->addMinutes(5) - ); + return Storage::url($this->path); } return env('APP_URL') . '/storage/' . $this->path; diff --git a/app/Models/Partner.php b/app/Models/Partner.php index 1a51a44..0fbac3a 100755 --- a/app/Models/Partner.php +++ b/app/Models/Partner.php @@ -53,10 +53,7 @@ class Partner extends Model { if (!empty($this->image)) { if (in_array(env('FILESYSTEM_DISK'), ['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/PaymentSystemItem.php b/app/Models/PaymentSystemItem.php index c39c716..51d6a5a 100755 --- a/app/Models/PaymentSystemItem.php +++ b/app/Models/PaymentSystemItem.php @@ -71,10 +71,7 @@ class PaymentSystemItem extends Model { if (!empty($this->logo)) { if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->logo, - Date::now()->addMinutes(5) - ); + return Storage::url($this->logo); } return env('APP_URL').'/'.$this->logo; diff --git a/app/Models/Post.php b/app/Models/Post.php index 99d41dc..89c9906 100755 --- a/app/Models/Post.php +++ b/app/Models/Post.php @@ -57,10 +57,7 @@ class Post extends Model { if (!empty($this->image)) { if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->image, - Date::now()->addMinutes(5) - ); + return Storage::url($this->image); } return $this->image; diff --git a/app/Models/Product.php b/app/Models/Product.php index b954c06..dd65d12 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/Screen.php b/app/Models/Screen.php index b8a6ec3..eb6fa6e 100755 --- a/app/Models/Screen.php +++ b/app/Models/Screen.php @@ -59,10 +59,7 @@ class Screen extends Model { if (!empty($this->path)) { if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->path, - Date::now()->addMinutes(5) - ); + return Storage::url($this->path); } return (string) $this->path; } @@ -77,10 +74,7 @@ class Screen extends Model { if (!empty($this->path_thumb)) { if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->path_thumb, - Date::now()->addMinutes(5) - ); + return Storage::url($this->path_thumb); } return (string) $this->path_thumb; } diff --git a/app/Models/Service.php b/app/Models/Service.php index 6e69c8f..48c18a6 100755 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -62,10 +62,7 @@ class Service extends Model { if (!empty($this->image)) { if (in_array(env('FILESYSTEM_DISK'), ['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/Slider.php b/app/Models/Slider.php index e6f7572..a8f4f4f 100755 --- a/app/Models/Slider.php +++ b/app/Models/Slider.php @@ -46,10 +46,7 @@ class Slider extends Model { if (!empty($this->image)) { if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->image, - Date::now()->addMinutes(5) - ); + return Storage::url($this->image); } return $this->image; } diff --git a/app/Models/SpecialOffer.php b/app/Models/SpecialOffer.php index f6b032b..6621978 100755 --- a/app/Models/SpecialOffer.php +++ b/app/Models/SpecialOffer.php @@ -48,9 +48,7 @@ class SpecialOffer extends Model { if (!empty($this->image)) { if (in_array(env('FILESYSTEM_DISK'), ['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/UsefulInfo.php b/app/Models/UsefulInfo.php index 37a83a5..3becae2 100755 --- a/app/Models/UsefulInfo.php +++ b/app/Models/UsefulInfo.php @@ -45,9 +45,7 @@ class UsefulInfo extends Model { if (!empty($this->image)) { if (in_array(env('FILESYSTEM_DISK'), ['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/UsefulInfoItem.php b/app/Models/UsefulInfoItem.php index 9d90d2a..6f0f1a1 100755 --- a/app/Models/UsefulInfoItem.php +++ b/app/Models/UsefulInfoItem.php @@ -64,10 +64,7 @@ class UsefulInfoItem extends Model { if (!empty($this->file_url)) { if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) { - return Storage::temporaryUrl( - $this->file_url, - Date::now()->addMinutes(5) - ); + return Storage::url($this->file_url); } return '/' . $this->file_url; } diff --git a/config/filesystems.php b/config/filesystems.php index e33a624..e3c4daf 100755 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -57,14 +57,15 @@ return [ ], 's3' => [ 'driver' => 's3', - 'key' => env('MINIO_ACCESS_KEY'), // Your MinIO access key - 'secret' => env('MINIO_SECRET_KEY'), // Your MinIO secret key - '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 - '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 + 'key' => env('MINIO_ACCESS_KEY'), + 'secret' => env('MINIO_SECRET_KEY'), + 'region' => env('MINIO_REGION', 'us-east-1'), + 'bucket' => env('MINIO_BUCKET'), + 'endpoint' => env('MINIO_ENDPOINT'), + 'url' => env('MINIO_PUBLIC_URL', env('MINIO_ENDPOINT')), + 'use_path_style_endpoint' => env('MINIO_USE_PATH_STYLE', true), + 'visibility' => 'public', + 'signature_version' => 'v4', ],