Example #1
0
$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();
    info('Your Valet domain has been updated to [' . $domain . '].');
})->descriptions('Get or set the domain used for Valet sites');
/**
 * Add the current working directory to the paths configuration.
 */
$app->command('park', function () {
    Configuration::addPath(getcwd());
    info("This directory has been added to Valet's paths.");
})->descriptions('Register the current working directory with Valet');
/**
 * Remove the current working directory to the paths configuration.
 */
$app->command('forget', function () {
    Configuration::removePath(getcwd());
    info("This directory has been removed from Valet's paths.");
})->descriptions('Remove the current working directory from Valet\'s list of paths');
/**
 * Remove the current working directory to the paths configuration.
 */
$app->command('status', function () {
    passthru('systemctl status caddy.service php7.0-fpm.service');
})->descriptions('View Valet service status');
Example #2
0
$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();
    info('Your Valet domain has been updated to [' . $domain . '].');
})->descriptions('Get or set the domain used for Valet sites');
/**
 * Add the current working directory to the paths configuration.
 */
$app->command('park [path]', function ($path = null) {
    Configuration::addPath($path ?: getcwd());
    info(($path === null ? "This" : "The [{$path}]") . " directory has been added to Valet's paths.");
})->descriptions('Register the current working (or specified) directory with Valet');
/**
 * Remove the current working directory from the paths configuration.
 */
$app->command('forget [path]', function ($path = null) {
    Configuration::removePath($path ?: getcwd());
    info(($path === null ? "This" : "The [{$path}]") . " directory has been removed from Valet's paths.");
})->descriptions('Remove the current working (or specified) directory from Valet\'s list of paths');
/**
 * Register a symbolic link with Valet.
 */
$app->command('link [name]', function ($name) {
    $linkPath = Site::link(getcwd(), $name = $name ?: basename(getcwd()));
    info('A [' . $name . '] symbolic link has been created in [' . $linkPath . '].');