option('encrypt')) { return $this->encryptFiles(); } if($this->option('decrypt')) { return $this->decryptFiles(); } } private function encryptFiles() { foreach ($this->files as $file) { $contents = Storage::disk('base')->get($file); $encrypted = encrypt($contents); Storage::disk('base')->put($file.".enc", $encrypted); } } private function decryptFiles() { foreach ($this->files as $file) { $encrypted_file = "{$file}.enc"; $contents = Storage::disk('base')->get($encrypted_file); $decrypted = decrypt($contents); Storage::disk('base')->put($file, $decrypted); } } }