category qosishsh to'g'irlandi
This commit is contained in:
@@ -48,13 +48,7 @@ class Request extends FormRequest
|
|||||||
public function getImage(): string
|
public function getImage(): string
|
||||||
{
|
{
|
||||||
if ($this->hasFile('image')) {
|
if ($this->hasFile('image')) {
|
||||||
if (env('FILESYSTEM_DISK') == 's3') {
|
|
||||||
$folder = "uploads/categories";
|
|
||||||
|
|
||||||
return Uploads::store($this->file('image'), $folder);
|
|
||||||
} else {
|
|
||||||
return Uploads::store($this->file('image'), 'uploads/categories', 'local');
|
return Uploads::store($this->file('image'), 'uploads/categories', 'local');
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return 'null';
|
return 'null';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ class Update extends FormRequest
|
|||||||
public function getImage(Category $category): ?string
|
public function getImage(Category $category): ?string
|
||||||
{
|
{
|
||||||
if ($this->hasFile('image')) {
|
if ($this->hasFile('image')) {
|
||||||
Storage::delete($category->image);
|
Storage::disk('local')->delete($category->image);
|
||||||
return Uploads::store($this->file('image'), 'uploads/categories');
|
return Uploads::store($this->file('image'), 'uploads/categories', 'local');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $category->image;
|
return $category->image;
|
||||||
|
|||||||
Reference in New Issue
Block a user