test
This commit is contained in:
@@ -62,7 +62,7 @@ class Brand extends Model
|
||||
public function getImage(): string
|
||||
{
|
||||
if (!empty($this->image)) {
|
||||
if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) {
|
||||
if (in_array(config('filesystems.default'), ['s3', 'minio'])) {
|
||||
return Storage::temporaryUrl(
|
||||
$this->image,
|
||||
Date::now()->addMinutes(5)
|
||||
|
||||
@@ -147,17 +147,17 @@ class Category extends Model
|
||||
public function getImage(): string
|
||||
{
|
||||
if (!in_array($this->image, ['null', null])) {
|
||||
if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) {
|
||||
if (in_array(config('filesystems.default'), ['s3', 'minio'])) {
|
||||
return Storage::temporaryUrl(
|
||||
$this->image,
|
||||
Date::now()->addMinutes(5)
|
||||
);
|
||||
}
|
||||
|
||||
return env('APP_URL') . '/' . $this->image;
|
||||
return config('app.url') . '/' . $this->image;
|
||||
}
|
||||
|
||||
return env('APP_URL') . '/images/nophoto.jpg';
|
||||
return config('app.url') . '/images/nophoto.jpg';
|
||||
}
|
||||
|
||||
public function getParentId(): int
|
||||
|
||||
@@ -236,28 +236,28 @@ class Product extends Model
|
||||
public function getPoster(): string
|
||||
{
|
||||
if (!empty($this->poster)) {
|
||||
if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) {
|
||||
if (in_array(config('filesystems.default'), ['s3', 'minio'])) {
|
||||
return Storage::temporaryUrl(
|
||||
$this->poster,
|
||||
Date::now()->addMinutes(5)
|
||||
);
|
||||
}
|
||||
return env('APP_URL') . '/' . $this->poster;
|
||||
return config('app.url') . '/' . $this->poster;
|
||||
}
|
||||
|
||||
return env('APP_URL') . '/images/no_product.jpg';
|
||||
return config('app.url') . '/images/no_product.jpg';
|
||||
}
|
||||
|
||||
public function getDataSheet()
|
||||
{
|
||||
if (!empty($this->data_sheet) and ($this->data_sheet != null and $this->data_sheet != "null")) {
|
||||
if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) {
|
||||
if (in_array(config('filesystems.default'), ['s3', 'minio'])) {
|
||||
return Storage::temporaryUrl(
|
||||
$this->data_sheet,
|
||||
Date::now()->addMinutes(5)
|
||||
);
|
||||
}
|
||||
return env('APP_URL') . '/' . $this->data_sheet;
|
||||
return config('app.url') . '/' . $this->data_sheet;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -265,16 +265,16 @@ class Product extends Model
|
||||
public function getPosterThumb(): string
|
||||
{
|
||||
if (!empty($this->poster_thumb)) {
|
||||
if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) {
|
||||
if (in_array(config('filesystems.default'), ['s3', 'minio'])) {
|
||||
return Storage::temporaryUrl(
|
||||
$this->poster_thumb,
|
||||
Date::now()->addMinutes(5)
|
||||
);
|
||||
}
|
||||
return env('APP_URL') . '/' . $this->poster_thumb;
|
||||
return config('app.url') . '/' . $this->poster_thumb;
|
||||
}
|
||||
|
||||
return env('APP_URL') . '/images/no_product.jpg';
|
||||
return config('app.url') . '/images/no_product.jpg';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user