-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Description
Hi!
I'm using the N+1 Query Detector package with the Debugbar output provider, and I've noticed that since laravel-debugbar v3.15.0 the "N+1 Query" tab is always empty, despite the fact lazy-loading queries are clearly visible in the Queries tab (and using another output provider also works).
To reproduce:
- Run:
composer create-project laravel/laravel:^12 test-debugbar && cd test-debugbar
composer require --dev barryvdh/laravel-debugbar
composer require --dev beyondcode/laravel-query-detector
php artisan vendor:publish --provider="BeyondCode\QueryDetector\QueryDetectorServiceProvider"
- Add
\BeyondCode\QueryDetector\Outputs\Debugbar::class
tooutput
inconfig/querydetector.php
- Add something in any controller that would trigger lazy-loading in a loop and visit the page
- See that the N+1 alert shows up, but the N+1 Queries tab remains empty
I've narrowed down the problem to this commit. It seems like this makes debugbar render before the laravel-query-detector middleware which is supposed to add messages to its collector.
I'm not entirely sure if this is something that should be fixed in debugbar or laravel-query-detector. Maybe query-detector could also add itself to the web
middleware group so it runs before debugbar renders.
Metadata
Metadata
Assignees
Labels
No labels