1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 08:30:07 +01:00

Merge pull request #311 from than/patch-1

Adds the ability to pass a directory to `valet open`
This commit is contained in:
Adam Wathan
2017-02-20 09:15:32 -05:00
committed by GitHub

View File

@@ -172,13 +172,13 @@
})->descriptions('Get all of the paths registered with Valet');
/**
* Open the current directory in the browser.
* Open the current or given directory in the browser.
*/
$app->command('open', function () {
$url = "http://".Site::host(getcwd()).'.'.Configuration::read()['domain'].'/';
$app->command('open [domain]', function ($domain = null) {
$url = "http://".($domain ?: Site::host(getcwd())).'.'.Configuration::read()['domain'];
passthru("open ".escapeshellarg($url));
})->descriptions('Open the site for the current directory in your browser');
})->descriptions('Open the site for the current (or specified) directory in your browser');
/**
* Generate a publicly accessible URL for your project.