test
This commit is contained in:
@@ -130,23 +130,9 @@ class Controller extends ExController
|
||||
|
||||
private function storeImageToS3($image): string
|
||||
{
|
||||
$path = '';
|
||||
|
||||
// first store temp file and resize it, then upload to s3
|
||||
// 1 - store temp file
|
||||
$tempPath = $image->store('temp', 'public');
|
||||
if ($tempPath) {
|
||||
$tempFilePath = storage_path('app/public/' . $tempPath);
|
||||
$image = new ImageResize();
|
||||
$path = $image->resize($tempPath, 322, 'brands');
|
||||
|
||||
// 2 - upload to s3 or keep local
|
||||
if (in_array(env('FILESYSTEM_DISK'), ['s3', 'minio'])) {
|
||||
Storage::disk('s3')->put($path, file_get_contents($path));
|
||||
unlink($path);
|
||||
}
|
||||
}
|
||||
|
||||
return $path;
|
||||
|
||||
$resizer = new ImageResize();
|
||||
return $resizer->resize($tempPath, 322, 'brands', true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user