diff --git a/src/DB.php b/src/DB.php index 972eee7..e097e40 100644 --- a/src/DB.php +++ b/src/DB.php @@ -433,6 +433,12 @@ public function fetchPretty(callable|DataRules $rules): ?array { $data = $this->fetch(); if (is_array($data)) { + if($rules instanceof DataRules){ + // $rules = $rules->getRules(); + $rules = function($rules){ + $rules; + }; + } return (new DataOptimizer($data))->optimize($rules); } return null;