database-visualizer / laravel
Zero-config local database schema visualizer & route query execution flow tracer for Laravel
Package info
github.com/Pasindu-Fdo/Database-Visualizer-Laravel
Language:HTML
pkg:composer/database-visualizer/laravel
v1.1.0
2026-09-17 17:18 UTC
Requires
- php: ^8.1
- illuminate/console: ^10.0|^11.0|^12.0|^13.0
- illuminate/database: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
- symfony/process: ^6.2|^7.0|^8.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A lightweight, zero-configuration local development package for Laravel to visualize database schema structure and trace SQL execution flows for any HTTP route in real time.
Features
- Schema Visualizer: Interactive ER diagrams, table relationships, index listings, and column metadata.
- Route Query Tracer: Replay any Web or API route (
GET,POST,PUT,DELETE) and watch SQL queries fire live. - Real-Time Data Transfer Flow: Visual execution flow showing how data moves between your application routes and database tables.
- Automatic Zero-Config Auth Bypass: Automatically logs in as an available user in
localenvironment without pasting cookies or headers. - Automatic CSRF Token Handling: Post form data or trigger state-mutating endpoints cleanly without
419 Page Expirederrors. - Read / Write / Mutate Breakdown: Instant counts and timing analysis for
SELECT,INSERT,UPDATE, andDELETEqueries per table.
Overview & Functionality
+-----------------------------------------------------------------------------------+
| Laravel Application (APP_ENV=local) |
| http://127.0.0.1:8000 |
+-----------------------------------------------------------------------------------+
▲
│ Proxy HTTP Request + X-DB-Tracer
│ (Auto Auth + Auto CSRF Token)
▼
+-----------------------------------------------------------------------------------+
| Route Query Tracer & Visualizer |
| http://127.0.0.1:7331/tracer.html |
+-----------------------------------------------------------------------------------+
| [ GET ] /admin/bookings [ TRACE RUN ] |
+-----------------------------------------------------------------------------------+
| |
| [ Request Flow Visualizer ] |
| Route [/admin/bookings] ─── (SELECT * FROM users) ────> [ users ] |
| ─── (SELECT * FROM bookings) ─> [ bookings ] |
| |
| [ Execution Timeline & SQL Queries ] |
| #1 0.8ms SELECT * FROM `users` WHERE `id` = 1 LIMIT 1 |
| #2 1.4ms SELECT `bookings`.*, `users`.`name` FROM `bookings` ... |
+-----------------------------------------------------------------------------------+
Quick Start
1. Installation
Add to your Laravel application in local development:
composer require --dev database-visualizer/laravel
2. Run the Visualizer & Tracer
Run the Artisan command from your project terminal:
php artisan db:viewer
The command will automatically launch the interactive dashboard at:
http://127.0.0.1:7331(Schema Visualizer)http://127.0.0.1:7331/tracer.html(Route Query Tracer)
How to Use the Route Query Tracer
- Make sure your main Laravel application is running (e.g.
php artisan serveonhttp://127.0.0.1:8000). - Run
php artisan db:viewer. - Open
http://127.0.0.1:7331/tracer.html. - Enter any route URL from your application (e.g.,
/api/profileor/admin/dashboard). - Click Trace Request.
- View the exact execution flow:
- Table Cards: Displays total query counts, reads, writes, and mutations per table.
- Data Flow Graph: Demonstrates query execution order.
- Detailed SQL Timeline: Full SQL code, bindings, execution times in milliseconds, and call sequence.
Configuration & Options
Publish the configuration file (optional):
php artisan vendor:publish --tag=db-viewer-config
Config file (config/db-viewer.php):
return [ 'host' => env('DB_VIEWER_HOST', '127.0.0.1'), 'port' => (int) env('DB_VIEWER_PORT', 7331), 'tracer' => [ 'enabled' => env('DB_TRACER_ENABLED', true), 'app_url' => env('DB_TRACER_APP_URL', env('APP_URL', 'http://127.0.0.1:8000')), 'timeout_seconds' => (int) env('DB_TRACER_TIMEOUT', 30), // Auto-authenticates as the first available user in local DB. // Set to a specific ID (e.g. 5) or 0 to disable. 'auth_user_id' => env('DB_TRACER_AUTH_USER_ID', 'auto'), ], ];
Command Flags
# Custom port or host php artisan db:viewer --port=8080 --host=0.0.0.0 # Specify custom DB connection php artisan db:viewer --connection=sqlite # Do not auto-open browser php artisan db:viewer --no-open
Security & Safety
- The query tracer middleware is strictly inactive unless
APP_ENV=local. - Non-local environments return raw untouched HTTP responses.
- The visualizer server binds to
127.0.0.1locally by default.