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