This commit is contained in:
2026-04-15 19:34:56 +05:00
parent 34ffed1e4a
commit e243821f50
26 changed files with 2072 additions and 1258 deletions

View File

@@ -79,19 +79,23 @@ class ChildUpdate
{
if (!empty($screens)) {
foreach ($screens as $screen) {
if ($screen['id'] == 'undefined' || $screen['id'] == 'null' || $screen['id'] = null) {
if ($screen['id'] == 'undefined' || $screen['id'] == 'null' || $screen['id'] == null) {
$folder = Carbon::now()->format('Y/m/d');
if ($screen['image']) {
// 1. Store original (S3 if enabled)
$path = $screen['image']->store("uploads/screens/{$folder}");
$image = Screen::create([
// 2. Local temp for resizing
$tempPath = $screen['image']->store('temp', 'public');
$thumbPath = $this->image->resize($tempPath, 322, 'screens', true);
Screen::create([
'path' => $path,
'path_thumb' => "uploads/screens/thumbs/{$folder}/" . basename($path),
'path_thumb' => $thumbPath,
'name' => basename($path),
'product_id' => $child_id,
'size' => Storage::size($path)
'size' => Storage::disk(env('FILESYSTEM_DISK'))->size($path)
]);
$this->image->resize($image->path, 322, 'screens');
}
}
}