curl_file_create($asset) ]); $response = curl_exec($ch); $error = curl_error($ch); if ((is_string($error)) && (strlen($error) > 0)) { throw new \Exception($error); } curl_close($ch); return json_decode($response); } catch (\Exception $e) { throw $e; } } /** * @param $asset * @return mixed * @throws \Exception */ private static function queryGet($asset) { try { $ch = curl_init(self::API_ENDPOINT . '?api-key=' . app('plantrec_apikey') . '&images=' . $asset); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, false); $response = curl_exec($ch); $error = curl_error($ch); if ((is_string($error)) && (strlen($error) > 0)) { throw new \Exception($error); } curl_close($ch); return json_decode($response); } catch (\Exception $e) { throw $e; } } }