argument('file'); if (!file_exists($file)) { $this->error(sprintf('File "%s" does not seem to exist.', $file)); return; } $content = file_get_contents($file); $content = Crypt::encrypt($content); $newName = $this->argument('key') . '.upload'; $path = storage_path('upload') . '/' . $newName; file_put_contents($path, $content); $this->line(sprintf('Encrypted "%s" and put it in "%s"', $file, $path)); } }