restore composer.json, add mysqli extension
This commit is contained in:
@@ -17,8 +17,8 @@ class ImageResize
|
||||
$folder = Carbon::now()->format('Y/m/d');
|
||||
$path = "uploads/{$type}/thumbs/{$folder}";
|
||||
|
||||
if (!file_exists($path)) {
|
||||
mkdir($path, 0755, true);
|
||||
if (!file_exists(public_path($path))) {
|
||||
mkdir(public_path($path), 0775, true);
|
||||
}
|
||||
|
||||
return $path;
|
||||
@@ -49,11 +49,15 @@ class ImageResize
|
||||
$img->save("{$path_thumb}", 100);
|
||||
Storage::disk('s3')->put($path_thumb, file_get_contents($path_thumb));
|
||||
} else {
|
||||
$img = Imagee::make(public_path($path));
|
||||
// source can be in storage/app/public (from ->store('temp','public')) or public/
|
||||
$srcPath = file_exists(public_path($path))
|
||||
? public_path($path)
|
||||
: storage_path('app/public/' . $path);
|
||||
$img = Imagee::make($srcPath);
|
||||
$img->resize($size, null, function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
});
|
||||
$img->save(public_path() . "/{$path_thumb}", 100);
|
||||
$img->save(public_path($path_thumb), 100);
|
||||
}
|
||||
return $path_thumb;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,8 @@ class Update extends FormRequest
|
||||
Storage::disk('s3')->delete($product->poster);
|
||||
} else {
|
||||
// delete old file
|
||||
unlink($product->poster);
|
||||
$oldPath = public_path($product->poster);
|
||||
if (is_file($oldPath)) unlink($oldPath);
|
||||
}
|
||||
|
||||
$folder = "uploads/posters/" . Carbon::now()->format('Y/m/d');
|
||||
|
||||
0
storage/.DS_Store
vendored
Normal file → Executable file
0
storage/.DS_Store
vendored
Normal file → Executable file
Reference in New Issue
Block a user