mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-21 23:20:24 +00:00
Update Domain.php
This commit is contained in:
parent
18dfe257fb
commit
469a6c8c43
1 changed files with 7 additions and 11 deletions
|
@ -83,14 +83,8 @@ class Domain extends Model
|
|||
|
||||
});
|
||||
|
||||
static::updating(function ($model) {
|
||||
$model->configureVirtualHost(true);
|
||||
});
|
||||
|
||||
static::saved(function ($model) {
|
||||
|
||||
$model->configureVirtualHost(true);
|
||||
|
||||
$apacheBuild = new ApacheBuild();
|
||||
$apacheBuild->build();
|
||||
|
||||
|
@ -101,12 +95,14 @@ class Domain extends Model
|
|||
if (empty($model->domain_public)) {
|
||||
return;
|
||||
}
|
||||
$findHostingSubscription = HostingSubscription::where('id', $model->hosting_subscription_id)->first();
|
||||
if (! $findHostingSubscription) {
|
||||
return;
|
||||
}
|
||||
|
||||
ShellApi::safeDelete($model->domain_root, ['/home/' . $findHostingSubscription->system_username]);
|
||||
if ($model->is_main == 1) {
|
||||
$findHostingSubscription = HostingSubscription::where('id', $model->hosting_subscription_id)->first();
|
||||
if (!$findHostingSubscription) {
|
||||
return;
|
||||
}
|
||||
ShellApi::safeDelete($model->domain_root, ['/home/' . $findHostingSubscription->system_username]);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue