restore composer.json, add mysqli extension

This commit is contained in:
2026-04-15 17:30:48 +05:00
parent 77cf56a348
commit 3a99fdb433
3 changed files with 10 additions and 5 deletions

View File

@@ -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;
}

View File

@@ -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');