storage url o'zgartirildi
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Http\Requests\Dashboard\Category;
|
||||
|
||||
use App\Support\Uploads;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class Request extends FormRequest
|
||||
@@ -44,9 +44,9 @@ class Request extends FormRequest
|
||||
if (env('FILESYSTEM_DISK') == 's3') {
|
||||
$folder = "uploads/categories";
|
||||
|
||||
return (string) $this->file('image')->store($folder);
|
||||
return Uploads::store($this->file('image'), $folder);
|
||||
} else {
|
||||
return $this->file('image')->store('uploads/categories', 'local');
|
||||
return Uploads::store($this->file('image'), 'uploads/categories', 'local');
|
||||
}
|
||||
} else {
|
||||
return 'null';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Requests\Dashboard\Category;
|
||||
|
||||
use App\Models\Category;
|
||||
use App\Support\Uploads;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -44,7 +45,7 @@ class Update extends FormRequest
|
||||
{
|
||||
if ($this->hasFile('image')) {
|
||||
Storage::delete($category->image);
|
||||
return (string) $this->file('image')->store('uploads/categories');
|
||||
return Uploads::store($this->file('image'), 'uploads/categories');
|
||||
}
|
||||
|
||||
return $category->image;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Http\Requests\Dashboard\Product;
|
||||
|
||||
use App\Support\Uploads;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use App\Api\ImageResize;
|
||||
|
||||
class Store extends FormRequest
|
||||
@@ -71,7 +71,7 @@ class Store extends FormRequest
|
||||
{
|
||||
$folder = "uploads/posters/" . Carbon::now()->format('Y/m/d');
|
||||
|
||||
return (string) $this->file('poster')->store($folder);
|
||||
return Uploads::store($this->file('poster'), $folder);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,7 +81,7 @@ class Store extends FormRequest
|
||||
{
|
||||
if ($this->hasFile('calc')) {
|
||||
$folder = "uploads/calc/" . Carbon::now()->format('Y/m/d');
|
||||
return (string) $this->file('calc')->store($folder);
|
||||
return Uploads::store($this->file('calc'), $folder);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -90,7 +90,7 @@ class Store extends FormRequest
|
||||
{
|
||||
if ($this->hasFile('data_sheet')) {
|
||||
$folder = "uploads/datasheet/" . Carbon::now()->format('Y/m/d');
|
||||
return (string) $this->file('data_sheet')->store($folder);
|
||||
return Uploads::store($this->file('data_sheet'), $folder);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -102,7 +102,7 @@ class Store extends FormRequest
|
||||
public function getPosterThumb()
|
||||
{
|
||||
$image = $this->file('poster');
|
||||
$tempPath = $image->store('temp', 'public');
|
||||
$tempPath = Uploads::store($image, 'temp', 'public');
|
||||
|
||||
$resizer = new ImageResize();
|
||||
return $resizer->resize($tempPath, 322, 'posters', true);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Requests\Dashboard\Product;
|
||||
|
||||
use App\Support\Uploads;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
@@ -65,7 +66,7 @@ class Update extends FormRequest
|
||||
if ($this->hasFile('poster')) {
|
||||
Storage::delete($product->poster);
|
||||
$folder = "uploads/posters/" . Carbon::now()->format('Y/m/d');
|
||||
return (string) $this->file('poster')->store($folder);
|
||||
return Uploads::store($this->file('poster'), $folder);
|
||||
}
|
||||
|
||||
return $product->poster;
|
||||
@@ -81,7 +82,7 @@ class Update extends FormRequest
|
||||
Storage::delete($product->calc);
|
||||
}
|
||||
$folder = "uploads/calc/" . Carbon::now()->format('Y/m/d');
|
||||
return (string) $this->file('calc')->store($folder);
|
||||
return Uploads::store($this->file('calc'), $folder);
|
||||
}
|
||||
return $product->calc;
|
||||
}
|
||||
@@ -93,7 +94,7 @@ class Update extends FormRequest
|
||||
Storage::delete($product->data_sheet);
|
||||
}
|
||||
$folder = "uploads/datasheet/" . Carbon::now()->format('Y/m/d');
|
||||
return (string) $this->file('data_sheet')->store($folder);
|
||||
return Uploads::store($this->file('data_sheet'), $folder);
|
||||
}
|
||||
|
||||
return $product->data_sheet;
|
||||
@@ -106,7 +107,7 @@ class Update extends FormRequest
|
||||
{
|
||||
if ($this->hasFile('poster')) {
|
||||
Storage::delete($product->poster_thumb);
|
||||
$tempPath = $this->file('poster')->store('temp', 'public');
|
||||
$tempPath = Uploads::store($this->file('poster'), 'temp', 'public');
|
||||
$resizer = new ImageResize();
|
||||
return $resizer->resize($tempPath, 322, 'posters', true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user