Systematically finding N+1 problems
Here’s a practical workflow for N+1 debugging with Telescope. Rather than merely noticing “the same SELECT is being repeated,” you can run through the whole cycle including post-fix verification.Find slow requests in Requests
Open
/telescope and, on the Requests tab, identify long-running requests.Inspect the executed SQL in Queries
Opening the request details shows every SQL query executed during that request. If similar SELECTs repeat, that’s an N+1.
dd() calls or extra logging to your code.
Tracking specific requests with tags
Telescope has a tags feature. Attaching arbitrary tags to entries withTelescope::tag() lets you quickly filter the dashboard to just entries with a tag.
This is extremely useful when you want to trace only the activity related to a specific user or order ID.
user:42 in the Search box on /telescope/requests lists only requests from user 42.
Auto-tagging models
Thetags method on TelescopeServiceProvider can add a specific model ID to every entry.
HasTags contract on a model automatically adds tags when that model is recorded.
Using the Dump watcher
Usingdump() can inject output into HTML responses and make API debugging awkward. The Telescope Dump watcher separates dump() output from the browser response and records it in the dashboard.
Usage is simple: open the “Dump” tab in /telescope and then call dump().
dd(), it doesn’t halt execution, which is handy when debugging across a stream of consecutive requests.
Comfortable email debugging with Mailpit integration
Combining the Mail watcher with the local SMTP server Mailpit dramatically improves email development.Debugging events and listeners
Debugging event-driven code is often tricky. Chasing “is the event firing?” and “which listeners run?” through logs is tedious. Telescope’s Events watcher lists dispatched events together with their listeners. If a listener isn’t firing, check the event entry on the Events tab.- Event is dispatched but no listeners appear → the listener isn’t registered (check
EventServiceProvider) - The event isn’t dispatched at all → check where
event()is called
Debugging queued jobs
Debugging async processing purely from logs makes it hard to pin down issues. Telescope’s Jobs watcher records everything from dispatch to execution result. Clicking a failed job entry shows the stack trace and exception message. You can inspect failures in Telescope in addition to thequeue:failed table, so you can identify the root cause quickly.
Debugging the HTTP client
When debugging communication with external APIs, the HTTP Client Watcher is useful. Requests made with theHttp:: facade and their responses are recorded.
dd($response->json()).
Summary
| Technique | Benefit |
|---|---|
| N+1 workflow | Systematically find and fix query issues without dd() |
| Tagging | Filter recordings for a specific user or model quickly |
| Dump watcher | Inspect dump output without polluting API responses |
| Mailpit integration | Comfortable local email development |
| Events watcher | Visualize event and listener firing |
| Jobs + sync | Debug async processing by running it synchronously |
| HTTP client | Record and inspect external API communication |
Laravel Telescope guide
See the guide page for installation and detailed watcher settings.
Laravel Nightwatch
Monitor production with Nightwatch.