diff --git a/src/alforge/Deploy.php b/src/alforge/Deploy.php index da03894..cc0abaa 100644 --- a/src/alforge/Deploy.php +++ b/src/alforge/Deploy.php @@ -38,8 +38,11 @@ public function execute($command) if($this->confirm("Are you sure you want to deploy the site `$site->name` on `$server->name`?")){ $response = $this->apiRequest("https://forge.laravel.com/api/v1/servers/$cmdParts[0]/sites/$cmdParts[1]/deployment/deploy"); + + $data = json_decode($response); + $this->respond( - "Status: ".$response->site->deployment_status, + "Status: ".$data->site->deployment_status, ["push_title" => "Deploying `$site->name` on `$server->name`"] ); } diff --git a/src/alforge/Forge.php b/src/alforge/Forge.php index 83acedb..3097b51 100644 --- a/src/alforge/Forge.php +++ b/src/alforge/Forge.php @@ -76,7 +76,7 @@ public function apiRequest($url, $method = 'POST', $data = '') die(); } - return json_decode($result); + return $result; } public function requestHasError($result, $code) diff --git a/src/alforge/Mysql.php b/src/alforge/Mysql.php index 3ee8f4b..06250f8 100644 --- a/src/alforge/Mysql.php +++ b/src/alforge/Mysql.php @@ -18,6 +18,9 @@ public function execute($server_id) if($this->confirm("Are you sure you want to restart MYSQL on `$server->name`?")){ $response = $this->apiRequest("https://forge.laravel.com/api/v1/servers/$server->id/mysql/reboot"); + + $data = json_decode($response); + $this->respond( "Command sent to Forge", ["push_title" => "Restarting MYSQL on `$server->name`"] diff --git a/src/alforge/Nginx.php b/src/alforge/Nginx.php index 6e6cc3d..06316b2 100644 --- a/src/alforge/Nginx.php +++ b/src/alforge/Nginx.php @@ -18,6 +18,9 @@ public function execute($server_id) if($this->confirm("Are you sure you want to restart Nginx on `$server->name`?")){ $response = $this->apiRequest("https://forge.laravel.com/api/v1/servers/$server->id/nginx/reboot"); + + $data = json_decode($response); + $this->respond( "Command sent to Forge", ["push_title" => "Restarting Nginx on `$server->name`"] diff --git a/src/alforge/Postgres.php b/src/alforge/Postgres.php index 479d160..58090ca 100644 --- a/src/alforge/Postgres.php +++ b/src/alforge/Postgres.php @@ -18,6 +18,9 @@ public function execute($server_id) if($this->confirm("Are you sure you want to restart Postgres on `$server->name`?")){ $response = $this->apiRequest("https://forge.laravel.com/api/v1/servers/$server->id/postgres/reboot"); + + $data = json_decode($response); + $this->respond( "Command sent to Forge", ["push_title" => "Restarting Postgres on `$server->name`"] diff --git a/src/alforge/Reboot.php b/src/alforge/Reboot.php index 98693b1..f6e46d2 100644 --- a/src/alforge/Reboot.php +++ b/src/alforge/Reboot.php @@ -18,6 +18,9 @@ public function execute($server_id) if($this->confirm("Are you sure you want to reboot the server `$server->name`?")){ $response = $this->apiRequest("https://forge.laravel.com/api/v1/servers/$server->id/reboot"); + + $data = json_decode($response); + $this->respond( "Command sent to Forge", ["push_title" => "Rebooting `$server->name`"]