Update HostingAccountIsCreatedListener.php
This commit is contained in:
parent
9cd8dcc15a
commit
5feda1a3c2
1 changed files with 13 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
namespace Modules\Microweber\Listeners;
|
||||
|
||||
use App\Events\HostingAccountIsCreated;
|
||||
use App\Models\HostingPlan;
|
||||
use App\ShellApi;
|
||||
use Modules\Microweber\App\Models\MicroweberInstallation;
|
||||
use Psy\Shell;
|
||||
|
@ -23,6 +24,18 @@ class HostingAccountIsCreatedListener
|
|||
public function handle(HostingAccountIsCreated $event): void
|
||||
{
|
||||
$findWebsite = \App\Models\Website::where('id', $event->model->id)->first();
|
||||
if (!$findWebsite) {
|
||||
return;
|
||||
}
|
||||
|
||||
$findHostingPlan = HostingPlan::where('id', $findWebsite->hosting_plan_id)->first();
|
||||
if (!$findHostingPlan) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!in_array('microweber', $findHostingPlan->additional_services)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$phyreShellExecutor = new \Modules\Microweber\Shell\Adapters\PhyreShellExecutor();
|
||||
|
||||
|
|
Loading…
Reference in a new issue