This commit is contained in:
Bozhidar 2024-05-13 14:30:41 +03:00
parent 8560554b5b
commit 6ea35dc7b6
2 changed files with 10 additions and 0 deletions

View file

@ -44,6 +44,14 @@ class Settings extends BaseSettings
// Make master domain virtual host
$masterDomain = new MasterDomain();
$masterDomain->configureVirtualHost();
$wildcardDomain = setting('general.wildcard_domain');
if (!empty($wildcardDomain)) {
$masterDomain = new MasterDomain();
$masterDomain->domain = $wildcardDomain;
$masterDomain->configureVirtualHost();
}
}
public function schema(): array|Closure
@ -59,6 +67,7 @@ class Settings extends BaseSettings
ColorPicker::make('general.brand_primary_color'),
TextInput::make('general.master_domain')->live(),
TextInput::make('general.wildcard_domain')->live(),
TextInput::make('general.master_email'),
Select::make('general.master_country')

View file

@ -45,6 +45,7 @@ class MasterDomain
$apacheVirtualHostBuilder->setDomainRoot($this->domainRoot);
$apacheVirtualHostBuilder->setHomeRoot($this->domainRoot);
$apacheVirtualHostBuilder->setServerAdmin($this->email);
$apacheVirtualHostBuilder->setDomainAlias('*.'.$this->domain);
$apacheBaseConfig = $apacheVirtualHostBuilder->buildConfig();