illuminated/db-profiler
A lightweight database profiler for Laravel that captures SQL queries, bindings, and execution times, helping you inspect query performance, spot slow or duplicate statements, and debug database behavior during development.
composer require illuminated/db-profiler --dev. The MIT license and active release cadence make it safe to keep in require-dev.config/app.php — check the README for the exact class name for your version.php artisan vendor:publish --tag=db-profiler-config (or publish by provider). This is the first place to look — it defines whether profiling is enabled, which middleware injects the toolbar, and which collectors run..env:
DB_PROFILER_ENABLED=true
Keep it false in .env.example and in any shared environment file.enabled flag from an env var (DB_PROFILER_ENABLED) rather than editing the config file, so every developer opts in locally without touching tracked files. Pair it with APP_DEBUG=true assumptions in your docs.web group (or wherever the config expects it). API-only apps should skip HTTP profiling entirely and use console mode.DB::listen/DB::enableQueryLog() and assert on query counts directly; the profiler is an interactive tool, not an assertion library.DB::listen collectors double the overhead and produce confusing duplicate counts. Pick one per environment.APP_ENV and the explicit env flag; also ensure deployments run composer install --no-dev so the package is not even present.php artisan config:cache has run locally, changes to .env or the config file have no effect. Run php artisan config:clear after toggling.Content-Length headers may break if the toolbar is appended. Verify behavior on download and export routes; disable the middleware there if needed.DB::listen dump instead of expecting the bar to appear.long_query_time. Tune the threshold in the config to match your app's expectations, and do not treat the profiler's judgment as authoritative for production performance work.composer.json and upgrade deliberately, since internal collector behavior and config keys can change between minors.require block matches your framework version; older Laravel releases may need an earlier package tag.DB::listen callback in a service provider to log queries to a file — the profiler's config is the easiest place to see how it hooks in.How can I help you explore Laravel packages today?