diff --git a/src/Services/EnvironmentService.php b/src/Services/EnvironmentService.php index ccb41fe..6682a83 100644 --- a/src/Services/EnvironmentService.php +++ b/src/Services/EnvironmentService.php @@ -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') + ); + } }