if (is_dir(VALET_HOME_PATH)) { Configuration::prune(); Site::pruneLinks(); } /** * Allow Valet to be run more conveniently by allowing the Node proxy to run password-less sudo. */ $app->command('install', function () { Caddy::stop(); Configuration::install(); Caddy::install(); PhpFpm::install(); DnsMasq::install(); Caddy::restart(); Valet::symlinkToUsersBin(); Brew::createSudoersEntry(); Valet::createSudoersEntry(); output(PHP_EOL . '<info>Valet installed successfully!</info>'); })->descriptions('Install the Valet services'); /** * Get or set the domain currently being used by Valet. */ $app->command('domain [domain]', function ($domain = null) { if ($domain === null) { return info(Configuration::read()['domain']); } DnsMasq::updateDomain($oldDomain = Configuration::read()['domain'], $domain = trim($domain, '.')); Configuration::updateKey('domain', $domain); Site::resecureForNewDomain($oldDomain, $domain); PhpFpm::restart(); Caddy::restart();