Stream database queries into a php artisan dev tab — like Pail, but for SQL.
In local development, DB Watch:
- Writes each query (with bindings + timing) to
storage/logs/queries.log - Registers a
dbprocess with Laravel'sDevCommands - Lets
php artisan db:watch(orphp artisan dev --tabs) stream those queries live
Slow queries highlight yellow/red. Pulse / Telescope / Horizon queries are ignored by default.
- PHP 8.2+
- Laravel 11, 12, or 13 (
DevCommandstab integration needs Laravel 13.16+)
composer require alexcavender/db-watch --devThat's it for Laravel 13. Restart php artisan dev and you should see a db tab.
Optional config publish:
php artisan vendor:publish --tag=db-watch-config# Stream queries (also runs automatically as a dev tab)
php artisan db:watch
# Only slow queries
php artisan db:watch --slow=50
# Filter by connection
php artisan db:watch --connection=mysql| Key | Default | Purpose |
|---|---|---|
enabled |
null (auto: local only) |
Force on/off via DB_WATCH_ENABLED |
environments |
['local'] |
Where streaming is active |
path |
storage/logs/queries.log |
Stream file location |
register_dev_command |
true |
Add the db tab to artisan dev |
dev_name |
db |
Tab name |
dev_color |
green |
Tab color |
ignore |
pulse_, telescope_, horizon_ |
SQL fragments to skip |
MIT