Update ApacheWebsiteCreate.php

This commit is contained in:
Bozhidar Slaveykov 2024-04-05 18:19:07 +03:00
parent 96a27d3980
commit 6904a51da7

View file

@ -12,6 +12,7 @@ class ApacheWebsiteCreate
public $user;
public $email;
public $password;
public $isMainDomain = false;
public $additionalServices = [];
public $features = [];
@ -45,6 +46,11 @@ class ApacheWebsiteCreate
$this->features = $features;
}
public function setIsMainDomain($isMainDomain)
{
$this->isMainDomain = $isMainDomain;
}
public function handle()
{
$getLinuxUser = new GetLinuxUser();
@ -55,10 +61,19 @@ class ApacheWebsiteCreate
return false;
}
$allDomainsRoot = '/home/'.$this->user.'/domains';
$domainRoot = '/home/'.$this->user.'/domains/'.$this->domain;
$domainPublic = $domainRoot . '/public_html';
$homeRoot = '/home/'.$this->user;
if ($this->isMainDomain) {
$allDomainsRoot = '/home/' . $this->user . '/public_html';
$domainRoot = '/home/' . $this->user;
$domainPublic = '/home/' . $this->user . '/public_html';
$homeRoot = '/home/' . $this->user;
} else {
$allDomainsRoot = '/home/' . $this->user . '/domains';
$domainRoot = '/home/' . $this->user . '/domains/' . $this->domain;
$domainPublic = $domainRoot . '/public_html';
$homeRoot = '/home/' . $this->user;
}
$apacheVirtualHostConfigs = app()->virtualHostManager->getConfigs($this->additionalServices);