From c563f60a0f30a2bc922d3c331ac5201063aa36a6 Mon Sep 17 00:00:00 2001 From: erikn69 Date: Fri, 22 Mar 2024 17:48:01 -0500 Subject: [PATCH] Support yajra datatables trace file --- src/DataCollector/QueryCollector.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/DataCollector/QueryCollector.php b/src/DataCollector/QueryCollector.php index 941647ec..00da5bfa 100644 --- a/src/DataCollector/QueryCollector.php +++ b/src/DataCollector/QueryCollector.php @@ -298,6 +298,14 @@ protected function findSource() $sources = []; foreach ($stack as $index => $trace) { + if (($trace['class'] ?? null) == 'Yajra\DataTables\Services\DataTable') { + $reflector = new \ReflectionClass(get_class($trace['object'])); + $sources[] = $this->parseTrace($index, [ + 'class' => $reflector->getName(), + 'file' => $reflector->getFileName(), + ]); + } + $sources[] = $this->parseTrace($index, $trace); }