Add helper to get publically accessable domain from environment.
This commit is contained in:
parent
819cff3936
commit
177c7dacd0
1 changed files with 9 additions and 0 deletions
|
|
@ -47,4 +47,13 @@ class EnvironmentService
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPublicHostname(): string
|
||||||
|
{
|
||||||
|
return sprintf(
|
||||||
|
'%s://%s',
|
||||||
|
$this->get('SERVER_PORT', 43) == 443 ? 'https' : 'http',
|
||||||
|
$this->get('HTTP_HOST')
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue