From 4f10ce8864c35723da89a47f675d7ac67864fc95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20Th=C3=BCs?= Date: Sun, 15 Feb 2026 11:25:31 +0100 Subject: [PATCH 1/2] fix: handle string response in deploy command output The deploy API returns `{"message": "Deploy queued successfully"}` without a `data` wrapper. After `makeRequest()` processes this, `$deploying['data']` is `['message' => 'Deploy queued successfully']`. `Arr::first()` returns the string value, not an array, so indexing with `['message']` crashes: `Cannot access offset of type string on string`. Check whether the first value is an array before accessing its `message` key. This handles both response shapes gracefully. --- app/Commands/DeployCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Commands/DeployCommand.php b/app/Commands/DeployCommand.php index 110daf3..9798f02 100644 --- a/app/Commands/DeployCommand.php +++ b/app/Commands/DeployCommand.php @@ -99,7 +99,8 @@ protected function deploy($serverId, $siteId, $domain, $data, $isScheduled = fal exit(); } - $this->info(Arr::first($deploying['data'])['message']); + $firstValue = Arr::first($deploying['data']); + $this->info(is_array($firstValue) ? $firstValue['message'] : $firstValue); if ($isScheduled) { return; From fbb1061b14332e9235605b0662dd17ab7dacd0cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20Th=C3=BCs?= Date: Sun, 15 Feb 2026 11:35:23 +0100 Subject: [PATCH 2/2] fix: cast deployment ID to int for return type compliance `getLatestDeploymentId()` declares `?int` return type but the API returns the deployment ID as a string. Cast to `(int)` to satisfy the type declaration. --- app/Commands/DeployCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Commands/DeployCommand.php b/app/Commands/DeployCommand.php index 9798f02..efc1a47 100644 --- a/app/Commands/DeployCommand.php +++ b/app/Commands/DeployCommand.php @@ -187,7 +187,7 @@ private function getLatestDeploymentId(int $serverId, int $siteId): ?int try { $deployment = $poller->getLatestDeployment($serverId, $siteId); - return $deployment['id'] ?? null; + return isset($deployment['id']) ? (int) $deployment['id'] : null; } catch (Exception $e) { $this->error('Failed to get latest deployment: '.$e->getMessage());