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

@@ -33,18 +33,21 @@ class Screen
*/
public function handle()
{
$folder = Carbon::now()->format('Y/m/d');
//$folder = 'uploads/screens/'.date('Y', time()).'/'.Carbon::now()->format('m').'/'.Carbon::now()->format('d');
foreach ($this->request as $screen) {
$folder = Carbon::now()->format('Y/m/d');
// 1. Store original (S3 if enabled)
$path = $screen->store("uploads/screens/original/{$folder}");
$thumb = $this->img->resize($path, 350, 'screens');
// 2. Local temp for resizing
$tempPath = $screen->store('temp', 'public');
$thumb = $this->img->resize($tempPath, 350, 'screens', true);
$screens = new Screens();
$screens->name = basename($path);
$screens->path = $path;
$screens->path_thumb = $thumb;
$screens->size = filesize($path);
$screens->size = Storage::disk(env('FILESYSTEM_DISK'))->size($path);
$screens->product_id = $this->id;
$screens->save();
}