firmware = $firmware; } public function handle(): void { if (! Storage::disk('public')->exists('firmwares')) { Storage::disk('public')->makeDirectory('firmwares'); } try { $filename = "FW{$this->firmware->version_tag}.bin"; Http::sink(storage_path("app/public/firmwares/$filename")) ->get($this->firmware->url); $this->firmware->update([ 'storage_location' => "firmwares/$filename", ]); } catch (ConnectionException $e) { Log::error('Firmware download failed: '.$e->getMessage()); } catch (Exception $e) { Log::error('An unexpected error occurred: '.$e->getMessage()); } } }