diff --git a/cli/Valet/Site.php b/cli/Valet/Site.php index daf202ef1..7ccf92b6b 100644 --- a/cli/Valet/Site.php +++ b/cli/Valet/Site.php @@ -125,14 +125,21 @@ function parked() $certs = $this->getCertificates($certsPath); + $links = $this->getSites($this->sitesPath(), $certs); + $config = $this->config->read(); $parkedLinks = collect(); - foreach ($config['paths'] as $path) { + foreach (array_reverse($config['paths']) as $path) { if ($path === $this->sitesPath()) { continue; } - $parkedLinks = $parkedLinks->merge($this->getSites($path, $certs)); + // Only merge on the parked sites that don't interfere with the linked sites + $sites = $this->getSites($path, $certs)->filter(function ($site, $key) use ($links) { + return !$links->has($key); + }); + + $parkedLinks = $parkedLinks->merge($sites); } return $parkedLinks;