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';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
@section('content')
|
||||
<div id="app">
|
||||
<product-add :brands="{{ json_encode($brands) }}" :categories="{{ json_encode($categories) }}"
|
||||
:colors="{{ json_encode($colors) }}" :back-url="{{ json_encode($_SERVER['HTTP_REFERER']) }}" :measurement="{{ json_encode($measurement) }}"></product-add>
|
||||
:colors="{{ json_encode($colors) }}" :back-url="{{ json_encode(url()->previous()) }}" :measurement="{{ json_encode($measurement) }}"></product-add>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<div id="app">
|
||||
<product-edit :product="{{ json_encode($product) }}" :brands="{{ json_encode($brands) }}"
|
||||
:categories="{{ json_encode($categories) }}" :colors="{{ json_encode($colors) }}"
|
||||
:back-url="{{ json_encode($_SERVER['HTTP_REFERER']) }}" :measurement="{{ json_encode($measurement) }}"></product-edit>
|
||||
:back-url="{{ json_encode(url()->previous()) }}" :measurement="{{ json_encode($measurement) }}"></product-edit>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
Reference in New Issue
Block a user