protected function parse(string $key): array
    {
        if (strpos($key, '(') === false && strpos($key, ')') === false) {
            return ['field' => trim($key), 'operator' => ''];
        }

        if (!preg_match(static::REGEXP, $key, $matches)) {
            throw new InvalidFilterException("Invalid filter item '$key': Bad use of parentheses");
        }

        return array_only($matches, ['field', 'operator']) + ['operator' => ''];
    }
protected function parse(string $key): array
    {
        if (strpos($key, '(') === false && strpos($key, ')') === false) {
            return ['field' => trim($key), 'operator' => ''];
        }

        if (!preg_match(static::REGEXP, $key, $matches)) {
            throw new InvalidFilterException("Invalid filter item '$key': Bad use of parentheses");
        }

        return array_only($matches, ['field', 'operator']) + ['operator' => ''];
    }
protected function parse ( string $ key ) : array { if ( strpos ( $ key , '(' ) === false && strpos ( $ key , ')' ) === false ) { return [ 'field' => trim ( $ key ) , 'operator' => '' ] ; } if ( ! preg_match ( static :: REGEXP , $ key , $ matches ) ) { throw new InvalidFilterException ( "Invalid filter item '$key': Bad use of parentheses" ) ; } return array_only ( $ matches , [ 'field' , 'operator' ] ) + [ 'operator' => '' ] ; }
Parse the key into field and operator.

@param string $key
@return array
Parse the key into field and operator .