public static function quoteUrl($query) {
        $queryParts = explode(' ', Str::assert($query, 'query'));

        return trim(array_reduce($queryParts, function($carry, $part) {
            return $carry . (Url::is($part) ? ('"' . $part . '" ') : ($part . ' '));
        }));
    }