media = $media; } /** * Execute the job. * * @return void */ public function handle() { $media = $this->media; if (! $media) { return; } $localFs = config('filesystems.default') === 'local'; if ($localFs) { $path = storage_path('app/'.$media->media_path); if (! is_file($path)) { return; } } else { $disk = Storage::disk(config('filesystems.default')); if (! $disk->exists($media->media_path)) { return; } } try { $img = new Image; $img->resizeThumbnail($media); } catch (\Exception $e) { if (config('app.dev_log')) { Log::error('Thumbnail generation failed: '.$e->getMessage()); } } $media->processed_at = Carbon::now(); $media->save(); ImageUpdate::dispatch($media)->onQueue('mmo'); } }