This commit is contained in:
2026-04-15 23:34:01 +05:00
parent 17c7a84f71
commit 61e685b3ce
22 changed files with 38 additions and 17 deletions

View File

@@ -63,8 +63,12 @@ class Brand extends Model
{
if (!empty($this->image)) {
if (in_array(config('filesystems.default'), ['s3', 'minio'])) {
return Storage::url($this->image);
};
return Storage::temporaryUrl(
$this->image,
Date::now()->addMinutes(5)
);
}
;
return (string) '/' . $this->image;
}

View File

@@ -148,7 +148,10 @@ class Category extends Model
{
if (!in_array($this->image, ['null', null])) {
if (in_array(config('filesystems.default'), ['s3', 'minio'])) {
return Storage::url($this->image);
return Storage::temporaryUrl(
$this->image,
Date::now()->addMinutes(5)
);
}
return config('app.url') . '/' . $this->image;

View File

@@ -56,11 +56,14 @@ class Post extends Model
public function getImage(): string
{
if (!empty($this->image)) {
if (in_array(config('filesystems.default'), ['s3', 'minio'])) {
return Storage::url($this->image);
if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) {
return Storage::temporaryUrl(
$this->image,
Date::now()->addMinutes(5)
);
}
return config('app.url') . '/' . $this->image;
return $this->image;
}
return '/images/nophoto.jpg';

View File

@@ -237,7 +237,10 @@ class Product extends Model
{
if (!empty($this->poster)) {
if (in_array(config('filesystems.default'), ['s3', 'minio'])) {
return Storage::url($this->poster);
return Storage::temporaryUrl(
$this->poster,
Date::now()->addMinutes(5)
);
}
return config('app.url') . '/' . $this->poster;
}
@@ -249,7 +252,10 @@ 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::url($this->data_sheet);
return Storage::temporaryUrl(
$this->data_sheet,
Date::now()->addMinutes(5)
);
}
return config('app.url') . '/' . $this->data_sheet;
}
@@ -260,7 +266,10 @@ class Product extends Model
{
if (!empty($this->poster_thumb)) {
if (in_array(config('filesystems.default'), ['s3', 'minio'])) {
return Storage::url($this->poster_thumb);
return Storage::temporaryUrl(
$this->poster_thumb,
Date::now()->addMinutes(5)
);
}
return config('app.url') . '/' . $this->poster_thumb;
}

View File

@@ -45,10 +45,13 @@ class Slider extends Model
public function getImage(): string
{
if (!empty($this->image)) {
if (in_array(config('filesystems.default'), ['s3', 'minio'])) {
return Storage::url($this->image);
if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) {
return Storage::temporaryUrl(
$this->image,
Date::now()->addMinutes(5)
);
}
return config('app.url') . '/' . $this->image;
return $this->image;
}
return '/images/nophoto.jpg';

View File

@@ -26,7 +26,7 @@ class AppServiceProvider extends ServiceProvider
date_default_timezone_set('Asia/Tashkent');
// set lang to uz
if (App::environment(['staging', 'production'])) {
URL::forceScheme('https');
URL::forceScheme('http');
}
}
}

View File

@@ -62,7 +62,6 @@ 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB