From 4a6eb27d47ca9595cea103b0f33cbec338f214f6 Mon Sep 17 00:00:00 2001 From: Marian Hodorogea Date: Mon, 31 Jan 2022 15:33:51 +0200 Subject: [PATCH] Configure the amount of relevant traces to load --- config/debugbar.php | 1 + src/DataCollector/QueryCollector.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/debugbar.php b/config/debugbar.php index fe3b192d7..9597b0204 100644 --- a/config/debugbar.php +++ b/config/debugbar.php @@ -199,6 +199,7 @@ ], 'hints' => false, // Show hints for common mistakes 'show_copy' => false, // Show copy button next to the query + 'traces_count' => 5, // How many relevant traces to load ], 'mail' => [ 'full_log' => false, diff --git a/src/DataCollector/QueryCollector.php b/src/DataCollector/QueryCollector.php index 17c3f69eb..6f900f422 100644 --- a/src/DataCollector/QueryCollector.php +++ b/src/DataCollector/QueryCollector.php @@ -177,7 +177,7 @@ public function addQuery($query, $bindings, $time, $connection) if ($this->findSource) { try { - $source = array_slice($this->findSource(), 0, 5); + $source = array_slice($this->findSource(), 0, config('debugbar.options.db.traces_count')); } catch (\Exception $e) { } }