This commit is contained in:
Bozhidar 2024-04-30 18:03:36 +03:00
parent 663ad25541
commit 3e3e0633df
2 changed files with 9 additions and 1 deletions

View file

@ -15,6 +15,10 @@ class ApacheWebsiteDelete
public function handle()
{
if (empty($this->domain)) {
return false;
}
$apacheConf = '/etc/apache2/sites-available/'.$this->domain.'.conf';
shell_exec('rm -rf '.$apacheConf);

View file

@ -92,7 +92,11 @@ class Domain extends Model
static::deleting(function ($model) {
ShellApi::exec('rm -rf '.$model->domain_public);
if (empty($model->domain_public)) {
return;
}
shell_exec('rm -rf '.$model->domain_public);
$deleteApacheWebsite = new ApacheWebsiteDelete();
$deleteApacheWebsite->setDomain($model->domain);