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

Merge branch 'feature/support-parked-domains' of https://github.com/antonioribeiro/valet into antonioribeiro-feature/support-parked-domains

This commit is contained in:
Matt Stauffer
2022-04-13 23:05:38 -04:00
2 changed files with 23 additions and 5 deletions

View File

@@ -1073,6 +1073,24 @@ public function certificatesPath($url = null, $extension = null)
return $this->valetHomePath().'/Certificates'.$url.$extension;
}
/**
* Make the domain name based on parked domains or the internal TLD.
*
* @return string
*/
public function domain($domain)
{
if ($this->parked()->pluck('site')->contains($domain)) {
return $domain;
}
if ($parked = $this->parked()->where('path', getcwd())->first()) {
return $parked['site'];
}
return ($domain ?: $this->host(getcwd())).'.'.$this->config->read()['tld'];
}
/**
* Replace Loopback configuration line in Valet site configuration file contents.
*