From 9f14753994fa9a4220dad3c4dfb85075d96ee01a Mon Sep 17 00:00:00 2001 From: Jakub Srsen Date: Thu, 19 Aug 2021 15:16:34 +0100 Subject: [PATCH] Adds Default Subdomain --- app/Commands/ShareCommand.php | 7 +++++-- config/expose.php | 12 ++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/Commands/ShareCommand.php b/app/Commands/ShareCommand.php index 3ff49c5..72c76bf 100644 --- a/app/Commands/ShareCommand.php +++ b/app/Commands/ShareCommand.php @@ -25,6 +25,7 @@ public function handle() } $domain = config('expose.default_domain'); + $subdomain = config('expose.default_subdomain'); if (! is_null($this->option('server'))) { $domain = null; @@ -36,14 +37,16 @@ public function handle() if (! is_null($this->option('subdomain'))) { $subdomains = explode(',', $this->option('subdomain')); - $this->info('Trying to use custom domain: '.$subdomains[0]); + } elseif (! is_null($subdomain)) { + $subdomains = [$subdomain]; } else { $host = Str::beforeLast($this->argument('host'), '.'); $host = Str::beforeLast($host, ':'); $subdomains = [Str::slug($host)]; - $this->info('Trying to use custom domain: '.$subdomains[0].PHP_EOL); } + $this->info('Trying to use custom domain: '.$subdomains[0].PHP_EOL); + (new Factory()) ->setLoop(app(LoopInterface::class)) ->setHost($this->getServerHost()) diff --git a/config/expose.php b/config/expose.php index 6abbd3a..8f575c8 100644 --- a/config/expose.php +++ b/config/expose.php @@ -85,6 +85,18 @@ */ 'default_domain' => null, + /* + |-------------------------------------------------------------------------- + | Default Subdomain + |-------------------------------------------------------------------------- + | + | The custom subdomain to use when sharing sites with Expose. + | You can reserve subdomains using Expose Pro. + | Learn more at: https://expose.dev/get-pro + | + */ + 'default_subdomain' => null, + /* |-------------------------------------------------------------------------- | Default TLD