Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DB Watch

Stream database queries into a php artisan dev tab — like Pail, but for SQL.

What it does

In local development, DB Watch:

  1. Writes each query (with bindings + timing) to storage/logs/queries.log
  2. Registers a db process with Laravel's DevCommands
  3. Lets php artisan db:watch (or php artisan dev --tabs) stream those queries live

Slow queries highlight yellow/red. Pulse / Telescope / Horizon queries are ignored by default.

Requirements

  • PHP 8.2+
  • Laravel 11, 12, or 13 (DevCommands tab integration needs Laravel 13.16+)

Installation

composer require alexcavender/db-watch --dev

That'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

Usage

# 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

Configuration

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

License

MIT

About

Stream Laravel database queries as a php artisan dev tab

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages