public function geocodeQuery(GeoQueryInterface $query): Collection
    {
        $url = sprintf(
            array_get($this->config, 'endpoints.geocode'),
            urlencode($query->getText()),
            $query->getLimit()
        );

        $result = [];
        try {
            $result = $this->cacheCallback($url, function () use ($query, $url) {
                return $this->hydrateResponse(
                    $this->requestUrl($url, $query)
                );
            });
        }
        catch (Throwable $ex) {
            $this->log(sprintf(
                'Provider "%s" could not geocode address, "%s".',
                $this->getName(), $ex->getMessage()
            ));
        }

        return new Collection($result);
    }
public function geocodeQuery(GeoQueryInterface $query): Collection
    {
        $url = sprintf(
            array_get($this->config, 'endpoints.geocode'),
            urlencode($query->getText()),
            $query->getLimit()
        );

        $result = [];
        try {
            $result = $this->cacheCallback($url, function () use ($query, $url) {
                return $this->hydrateResponse(
                    $this->requestUrl($url, $query)
                );
            });
        }
        catch (Throwable $ex) {
            $this->log(sprintf(
                'Provider "%s" could not geocode address, "%s".',
                $this->getName(), $ex->getMessage()
            ));
        }

        return new Collection($result);
    }
public function geocodeQuery ( GeoQueryInterface $ query ) : Collection { $ url = sprintf ( array_get ( $ this -> config , 'endpoints.geocode' ) , urlencode ( $ query -> getText ( ) ) , $ query -> getLimit ( ) ) ; $ result = [ ] ; try { $ result = $ this -> cacheCallback ( $ url , function ( ) use ( $ query , $ url ) { return $ this -> hydrateResponse ( $ this -> requestUrl ( $ url , $ query ) ) ; } ) ; } catch ( Throwable $ ex ) { $ this -> log ( sprintf ( 'Provider "%s" could not geocode address, "%s".' , $ this -> getName ( ) , $ ex -> getMessage ( ) ) ) ; } return new Collection ( $ result ) ; }
Handle the geocoder request.

@param \Igniter\Flame\Geolite\Contracts\GeoQueryInterface $query
@return \Illuminate\Support\Collection
Handle the geocoder request .