src/Support/Helpers.php
public static function buildQuery(array $args)
    {
        if (!$args) {
            return '';
        }

        $args = array_map(function ($value) {
            if (is_array($value)) {
                return json_encode($value);
            } elseif (is_bool($value)) {
                return $value ? 'true' : 'false';
            } else {
                return $value;
            }
        }, $args);

        return http_build_query($args);
    }
public static function buildQuery(array $args)
    {
        if (!$args) {
            return '';
        }

        $args = array_map(function ($value) {
            if (is_array($value)) {
                return json_encode($value);
            } elseif (is_bool($value)) {
                return $value ? 'true' : 'false';
            } else {
                return $value;
            }
        }, $args);

        return http_build_query($args);
    }
public static function buildQuery ( array $ args ) { if ( ! $ args ) { return '' ; } $ args = array_map ( function ( $ value ) { if ( is_array ( $ value ) ) { return json_encode ( $ value ) ; } elseif ( is_bool ( $ value ) ) { return $ value ? 'true' : 'false' ; } else { return $ value ; } } , $ args ) ; return http_build_query ( $ args ) ; }
When building a query string, array values must be json_encoded.
This function can be used to turn any array into a Algolia-valid query string.

Do not use a typical implementation where ['key' => ['one', 'two']] is
turned into key[1]=one&key[2]=two. Algolia will not understand key[x].
It should be turned into key=['one','two'] (before being url_encoded).

@param array $args

@return string The urlencoded query string to send to Algolia
When building a query string array values must be json_encoded . This function can be used to turn any array into a Algolia - valid query string .