Update DomainIsCreatedListener.php

This commit is contained in:
Bozhidar Slaveykov 2024-04-06 15:57:32 +03:00
parent e574342c86
commit 000a0db564

View file

@ -3,7 +3,9 @@
namespace Modules\Microweber\Listeners;
use App\Events\DomainIsCreated;
use App\Models\Domain;
use App\Models\HostingPlan;
use App\Models\HostingSubscription;
use App\ShellApi;
use Modules\Microweber\App\Models\MicroweberInstallation;
use Psy\Shell;
@ -23,12 +25,16 @@ class DomainIsCreatedListener
*/
public function handle(DomainIsCreated $event): void
{
$findDomain = \App\Models\Domain::where('id', $event->model->id)->first();
$findDomain = Domain::where('id', $event->model->id)->first();
if (!$findDomain) {
return;
}
$findHostingSubscription = HostingSubscription::where('id', $findDomain->hosting_subscription_id)->first();
if (!$findHostingSubscription) {
return;
}
$findHostingPlan = HostingPlan::where('id', $findDomain->hosting_plan_id)->first();
$findHostingPlan = HostingPlan::where('id', $findHostingSubscription->hosting_plan_id)->first();
if (!$findHostingPlan) {
return;
}