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