http->request('POST', "{$this->url}/{$method}", [ 'form_params' => array_merge($params, [ 'access_token' => $this->token, 'v' => $this->version, ]), ]); $result = json_decode($response->getBody()->getContents(), true); if (isset($result['error'])) { $message = "VK API Error: " . $result['error']['error_msg']; Log::error($message); throw new Exception($message); } return $result; } }