mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 00:20:08 +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:
@@ -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.
|
||||
*
|
||||
|
||||
@@ -180,7 +180,7 @@
|
||||
* Secure the given domain with a trusted TLS certificate.
|
||||
*/
|
||||
$app->command('secure [domain] [--expireIn=]', function ($domain = null, $expireIn = 368) {
|
||||
$url = ($domain ?: Site::host(getcwd())).'.'.Configuration::read()['tld'];
|
||||
$url = Site::domain($domain);
|
||||
|
||||
Site::secure($url, null, $expireIn);
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
$url = ($domain ?: Site::host(getcwd())).'.'.Configuration::read()['tld'];
|
||||
$url = Site::domain($domain);
|
||||
|
||||
Site::unsecure($url);
|
||||
|
||||
@@ -280,8 +280,8 @@
|
||||
* Open the current or given directory in the browser.
|
||||
*/
|
||||
$app->command('open [domain]', function ($domain = null) {
|
||||
$url = 'http://'.($domain ?: Site::host(getcwd())).'.'.Configuration::read()['tld'];
|
||||
CommandLine::runAsUser('open '.escapeshellarg($url));
|
||||
$url = "http://".Site::domain($domain);
|
||||
CommandLine::runAsUser("open ".escapeshellarg($url));
|
||||
})->descriptions('Open the site for the current (or specified) directory in your browser');
|
||||
|
||||
/**
|
||||
@@ -295,7 +295,7 @@
|
||||
* Echo the currently tunneled URL.
|
||||
*/
|
||||
$app->command('fetch-share-url [domain]', function ($domain = null) {
|
||||
output(Ngrok::currentTunnelUrl($domain ?: Site::host(getcwd()).'.'.Configuration::read()['tld']));
|
||||
output(Ngrok::currentTunnelUrl(Site::domain($domain)));
|
||||
})->descriptions('Get the URL to the current Ngrok tunnel');
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user