mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 16:40:05 +01:00
shorten method
This commit is contained in:
@@ -28,7 +28,7 @@ function __construct(Configuration $config, CommandLine $cli, Filesystem $files)
|
||||
* @param string $path
|
||||
* @return string|null
|
||||
*/
|
||||
function hostForDirectory($path)
|
||||
function host($path)
|
||||
{
|
||||
foreach ($this->files->scandir($this->sitesPath()) as $link) {
|
||||
if ($resolved = realpath($this->sitesPath().'/'.$link) == $path) {
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
* Open the current directory in the browser.
|
||||
*/
|
||||
$app->command('open', function () {
|
||||
$url = "http://".Site::hostForDirectory(getcwd()).'.'.Configuration::read()['domain'].'/';
|
||||
$url = "http://".Site::host(getcwd()).'.'.Configuration::read()['domain'].'/';
|
||||
|
||||
passthru("open ".escapeshellarg($url));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user