1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-06 00:40:06 +01:00

Clean up DX for fetch-share-url

This commit is contained in:
Matt Stauffer
2022-12-25 23:59:25 -05:00
parent 5988c4f881
commit f13be53b9f
4 changed files with 29 additions and 7 deletions

View File

@@ -52,7 +52,7 @@ public function currentTunnelUrl(?string $domain = null): string
}
}
throw new DomainException('Tunnel not established.');
throw new DomainException('There is no Ngrok tunnel established for '.$domain.'.');
}
/**
@@ -72,6 +72,8 @@ public function findHttpTunnelUrl(array $tunnels, string $domain): ?string
return $tunnel->public_url;
}
}
return null;
}
/**

View File

@@ -1109,6 +1109,12 @@ public function domain(?string $domain): string
// return $parked['site'];
// }
// Don't add .TLD if user already passed the string in with the TLD on the end
if ($domain && str_contains($domain, '.'.$this->config->read()['tld'])) {
return $domain;
}
// Return either the passed domain, or the current folder name, with .TLD appended
return ($domain ?: $this->host(getcwd())).'.'.$this->config->read()['tld'];
}