From 7ac497aab2477a47d32ed6211008ad806ba1b85b Mon Sep 17 00:00:00 2001 From: Bozhidar Slaveykov Date: Sun, 7 Apr 2024 14:48:11 +0300 Subject: [PATCH] update --- web/app/ApiSDK/PhyreApiSDK.php | 7 +++++++ .../Controllers/Api/HostingSubscriptionsController.php | 4 ++-- web/app/Models/PhyreServer.php | 7 +++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/web/app/ApiSDK/PhyreApiSDK.php b/web/app/ApiSDK/PhyreApiSDK.php index af5cf08..5c92b9f 100644 --- a/web/app/ApiSDK/PhyreApiSDK.php +++ b/web/app/ApiSDK/PhyreApiSDK.php @@ -18,6 +18,13 @@ class PhyreApiSDK $this->username = $username; } + public function getHostingSubscriptions() + { + $response = $this->sendRequest('hosting-subscriptions', [], 'GET'); + + return $response; + } + public function getCustomers() { $response = $this->sendRequest('customers', [], 'GET'); diff --git a/web/app/Http/Controllers/Api/HostingSubscriptionsController.php b/web/app/Http/Controllers/Api/HostingSubscriptionsController.php index f78cab3..130d665 100644 --- a/web/app/Http/Controllers/Api/HostingSubscriptionsController.php +++ b/web/app/Http/Controllers/Api/HostingSubscriptionsController.php @@ -11,13 +11,13 @@ class HostingSubscriptionsController extends ApiController { public function index() { - $findHostingSubscription = HostingSubscription::all(); + $findHostingSubscriptions = HostingSubscription::all(); return response()->json([ 'status' => 'ok', 'message' => 'Hosting subscriptions found', 'data' => [ - 'HostingSubscriptions' => $findHostingSubscription, + 'hostingSubscriptions' => $findHostingSubscriptions, ], ]); diff --git a/web/app/Models/PhyreServer.php b/web/app/Models/PhyreServer.php index fa4509c..9e6fea0 100644 --- a/web/app/Models/PhyreServer.php +++ b/web/app/Models/PhyreServer.php @@ -82,6 +82,13 @@ class PhyreServer extends Model } + // Sync Hosting Subscriptions + $getExternalHostingSubscriptions = $phyreApiSDK->getHostingSubscriptions(); + if (isset($getExternalHostingSubscriptions['data']['hostingSubscriptions'])) { + dd($getExternalHostingSubscriptions['data']['hostingSubscriptions']); + } + dd($getExternalHostingSubscriptions); + // // Sync Hosting Plans // $getHostingPlans = HostingPlan::all();