mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 19:04:03 +00:00
Fix event listener tests, improve domain logic
This commit is contained in:
parent
0bbc66f451
commit
a602cec940
13 changed files with 148 additions and 14 deletions
|
|
@ -53,12 +53,10 @@ if (! function_exists('global_cache')) {
|
|||
}
|
||||
|
||||
if (! function_exists('tenant_route')) {
|
||||
function tenant_route($route, $parameters = [], string $domain = null)
|
||||
function tenant_route(string $domain, $route, $parameters = [], $absolute = true)
|
||||
{
|
||||
$domain = $domain ?? request()->getHost();
|
||||
|
||||
// replace first occurance of hostname fragment with $domain
|
||||
$url = route($route, $parameters);
|
||||
$url = route($route, $parameters, $absolute);
|
||||
$hostname = parse_url($url, PHP_URL_HOST);
|
||||
$position = strpos($url, $hostname);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue