environment('local')) { info('Sending SMS to '.$phone.' with message: '.$message); return true; } $client = new Client; $headers = [ 'Content-Type' => 'application/json;charset=utf-8;', 'Charset' => 'UTF-8', ]; $body = 'JSON={ "SendRequest": { "TerminalID": "Online_PANEL", "Version": "1", "Lang": "EN", "MobilePhone": "993'.$phone.'", "Text": "'.$message.'" } }'; // 10.3.158.103 $request = new GuzzleRequest('POST', 'http://10.3.158.28:8080/kpsmsroute/online.request', $headers, $body); try { $res = $client->sendAsync($request)->wait(); return $res->getBody(); // @phpstan-ignore-line } catch (Exception $e) { Log::error($e); return null; } } }