protected function setKeyInEnvironmentFile($key, $input, $output)
    {
        $currentKey = config('app.key');

        $helper = $this->getHelper('question');
        $question = new ConfirmationQuestion('Application key will re-generate. Are you sure?: ', false);
        if (strlen($currentKey) !== 0 && (! $helper->ask($input, $output, $question))) {
            return false;
        }

        $this->writeNewEnvironmentFileWith($key);
        return true;
    }