Skip to content

SQL Logging

See every database query executed by your code.

Overview

The SQL panel captures all database queries during code execution, showing:

  • Full SQL query text
  • Parameter bindings
  • Execution time
  • Query count

Enabling SQL Logging

SQL logging is enabled by default. Toggle it with:

  • Click the SQL toggle in the toolbar
  • The toggle turns amber when active

Viewing Queries

After running code, queries appear in the SQL panel:

┌─────────────────────────────────────────────────┐
│ SQL Queries (3)                          4.2ms  │
├─────────────────────────────────────────────────┤
│ select * from `users` where `active` = ?        │
│ Bindings: [true]                         1.2ms  │
├─────────────────────────────────────────────────┤
│ select * from `posts` where `user_id` in (?, ?) │
│ Bindings: [1, 2]                         2.1ms  │
├─────────────────────────────────────────────────┤
│ select count(*) from `comments`                 │
│ Bindings: []                             0.9ms  │
└─────────────────────────────────────────────────┘

Query Information

Each query shows:

SQL Text

The full query with placeholders (?) for bindings.

Bindings

The actual values substituted into the query:

sql
-- Query
select * from users where email = ? and active = ?

-- Bindings
["john@example.com", 1]

-- Actual executed query
select * from users where email = 'john@example.com' and active = 1

Execution Time

Time in milliseconds for the query to execute.

Query Number

Sequential number showing execution order.

Slow Query Detection

Queries over a certain threshold are highlighted:

TimeIndicator
< 10msGreen
10-100msYellow
> 100msRed

Built for Laravel developers.