public static function addSalts(Event $event)
    {
        $composer = $event->getComposer();
        $root     = preg_replace("/\/vendor/", '', $composer->getConfig()->get('vendor-dir'));
        $io       = $event->getIO();

        if (file_exists(sprintf('%s/.env', $root))) {
            return 1;
        }

        if (!$io->isInteractive()) {
            $generateSalts = $composer->getConfig()->get('generate-salts');
        } else {
            $generateSalts = $io->askConfirmation(
                '<info>Generate salts and append to .env file?</info> [<comment>Y,n</comment>]?',
                true
            );
        }

        if (!$generateSalts) {
            return 1;
        }

        $generator = new Generator();

        $salts = array_map(function ($key) use($generator) {
            return sprintf("%s='%s'", $key, $generator->generateSalt());
        }, self::$KEYS);

        $generator->writeToFile(sprintf('%s/.env', $root), $salts, $event);
    }