src/QueryParser.php
protected function parseSubquery(string $unparsed): array
    {
        // Strip parens that come with the request string
        $tableName = explode("(", $unparsed, 2);
        //print_r($tableName);die();
        $tableName = strtolower($tableName[0]);

        $modelName = str_replace('_', ' ', $tableName);
        $modelName = str_replace(' ', '', ucwords($modelName));

        //Add the namespace to the model name
        $model = $this->config['namespace']['models'] . '\\' . $modelName;

        $unparsed = str_replace($tableName, '', $unparsed);
        $unparsed = trim($unparsed, '()');

        // Now we have an array of "key:value" strings.
        $splitFields = explode(',', $unparsed);

        if (strpos($splitFields[0], '!::') !== false) {
            $action = 'not in';
            $fieldsToRelate = explode('!::', $splitFields[0]);
        } elseif (strpos($splitFields[0], '::') !== false) {
            $action = 'in';
            $fieldsToRelate = explode('::', $splitFields[0]);
        } else {
            throw new \Exception("Error Processing Subquery", 1);
        }

        $subquery = [
            'action' => $action,
            'firstField' => $fieldsToRelate[0],
            'secondField' => $fieldsToRelate[1],
            'model' => $model,
        ];

        return $subquery;
    }
protected function parseSubquery(string $unparsed): array
    {
        // Strip parens that come with the request string
        $tableName = explode("(", $unparsed, 2);
        //print_r($tableName);die();
        $tableName = strtolower($tableName[0]);

        $modelName = str_replace('_', ' ', $tableName);
        $modelName = str_replace(' ', '', ucwords($modelName));

        //Add the namespace to the model name
        $model = $this->config['namespace']['models'] . '\\' . $modelName;

        $unparsed = str_replace($tableName, '', $unparsed);
        $unparsed = trim($unparsed, '()');

        // Now we have an array of "key:value" strings.
        $splitFields = explode(',', $unparsed);

        if (strpos($splitFields[0], '!::') !== false) {
            $action = 'not in';
            $fieldsToRelate = explode('!::', $splitFields[0]);
        } elseif (strpos($splitFields[0], '::') !== false) {
            $action = 'in';
            $fieldsToRelate = explode('::', $splitFields[0]);
        } else {
            throw new \Exception("Error Processing Subquery", 1);
        }

        $subquery = [
            'action' => $action,
            'firstField' => $fieldsToRelate[0],
            'secondField' => $fieldsToRelate[1],
            'model' => $model,
        ];

        return $subquery;
    }
protected function parseSubquery ( string $ unparsed ) : array { // Strip parens that come with the request string $ tableName = explode ( "(" , $ unparsed , 2 ) ; //print_r($tableName);die(); $ tableName = strtolower ( $ tableName [ 0 ] ) ; $ modelName = str_replace ( '_' , ' ' , $ tableName ) ; $ modelName = str_replace ( ' ' , '' , ucwords ( $ modelName ) ) ; //Add the namespace to the model name $ model = $ this -> config [ 'namespace' ] [ 'models' ] . '\\' . $ modelName ; $ unparsed = str_replace ( $ tableName , '' , $ unparsed ) ; $ unparsed = trim ( $ unparsed , '()' ) ; // Now we have an array of "key:value" strings. $ splitFields = explode ( ',' , $ unparsed ) ; if ( strpos ( $ splitFields [ 0 ] , '!::' ) !== false ) { $ action = 'not in' ; $ fieldsToRelate = explode ( '!::' , $ splitFields [ 0 ] ) ; } elseif ( strpos ( $ splitFields [ 0 ] , '::' ) !== false ) { $ action = 'in' ; $ fieldsToRelate = explode ( '::' , $ splitFields [ 0 ] ) ; } else { throw new \ Exception ( "Error Processing Subquery" , 1 ) ; } $ subquery = [ 'action' => $ action , 'firstField' => $ fieldsToRelate [ 0 ] , 'secondField' => $ fieldsToRelate [ 1 ] , 'model' => $ model , ] ; return $ subquery ; }
Parses out the subquery parameters from a request.

in = ::, not in = !::

Unparsed, they will look like this:
internet_special(id::vehicles_id)
Parsed:
Array('action' => in, 'firstField' => id, 'secondField' => vehicles_id,'model' => MyDealer\Models\InternetSpecial)

*
@param  string $unparsed Unparsed search string
@return array            An array of fieldname=>value search parameters
Parses out the subquery parameters from a request .