private static function filterWithQuery($registros, $config, $datos = [], $orOperation = "_or", $queryStr = "_q", $attriStr = "_a", $aByAStr = "_aByA") {
        if (count($datos) == 0) {
            $datos = request()->all();
        }
        //echo "<pre>" . print_r($datos, true) . "</pre>";
        if (!is_bool($orOperation)) {
            if (isset($datos[$orOperation])) {
                $orOperation = !($datos[$orOperation] === 'false');
            } else {
                $orOperation = true;
            }
        }
        if (isset($datos[$queryStr])) {
            $query = $datos[$queryStr];
            if (\Sirgrimorum\CrudGenerator\CrudGenerator::isJsonString($query)) {
                $query = json_decode($query, true);
            } elseif (stripos($query, "|")) {
                $query = explode("|", $query);
            }
            if (isset($datos[$attriStr])) {
                $attri = $datos[$attriStr];
                if (\Sirgrimorum\CrudGenerator\CrudGenerator::isJsonString($attri)) {
                    $attri = json_decode($attri, true);
                } elseif (stripos($attri, "|")) {
                    $attri = explode("|", $attri);
                }
            } else {
                $attri = $config['nombre'];
            }
            $fbf = isset($datos[$aByAStr]);
            $registros = $registros->filter(function($registro) use($query, $attri, $fbf, $orOperation) {
                return \Sirgrimorum\CrudGenerator\CrudGenerator::evaluateFilter($registro, $query, $attri, $orOperation, $fbf);
            });
        }
        return $registros;
    }