comment(Inspiring::quote()); })->purpose('Display an inspiring quote')->hourly(); //Schedule::call(function () { // Log::info('Menjalankan CompressLogbookImages via schedule'); // (new CompressLogbookImages)->handle(); //})->everyMinute()->name('compress-logbook-images')->withoutOverlapping(); Artisan::command('resize:all-logbook', function () { $directory = storage_path('app/public/thumbnail'); $files = glob($directory . '/*.{jpg,jpeg,png,webp}', GLOB_BRACE); $count = 0; foreach ($files as $fullPath) { try { $image = Image::read($fullPath) ->scaleDown(width: 800) ->save($fullPath, quality: 85); $count++; } catch (\Exception $e) { Log::error("Gagal resize {$fullPath}: " . $e->getMessage()); } } Log::info("Resize selesai: {$count} gambar diubah ukurannya menjadi lebar 800px."); $this->info("Resize selesai: {$count} gambar diubah ukurannya menjadi lebar 800px."); });