This commit is contained in:
2026-04-16 04:05:10 +05:00
parent eea40876a4
commit 2ba5677c45
18 changed files with 35 additions and 84 deletions

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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);
}
;

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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',
],