Add helper to get publically accessable domain from environment.

This commit is contained in:
Greyscale 2021-02-13 22:42:49 +01:00
parent 819cff3936
commit 177c7dacd0

View file

@ -47,4 +47,13 @@ class EnvironmentService
return $this;
}
public function getPublicHostname(): string
{
return sprintf(
'%s://%s',
$this->get('SERVER_PORT', 43) == 443 ? 'https' : 'http',
$this->get('HTTP_HOST')
);
}
}