url = env('SD_DUCKLING_URL'); // $this->url = 'host.docker.internal:5000/parse'; } public function execute($content, $dimensions) { // @TODO Parse result return $this->sendRequest($content, $dimensions); } protected function sendRequest($text, $dimensions) { $client = new Client(); $response = $client->request('post', $this->url, [ 'headers' => [ 'Accept' => 'application/json', ], 'form_params' => [ 'locale' => 'en_GB', 'text' => $text, 'dims' => json_encode($dimensions), ], ]); return json_decode($response->getBody()->getContents(), true); } }