Back

Hey Laravel Developers

One common mistake I’ve seen junior developers make is using the dd() method and expecting to find the request traces inside Laravel Telescope but it does not show any traces.

This happens due to how Laravel Telescope is configured to insert logs into the database.

Telescope doesn’t immediately write entries to the database when events occur.

Instead, it stores them in memory and inserts them together when the request is terminating.

This helps reduce the number of total queries made by Telescope for logging.

However, if you use a dd() statement, the in-memory entries won’t get stored in the database because the app-terminating event isn’t triggered—dd() halts the execution of the PHP script immediately.

So, always use the dump() or logger() functions when debugging with Laravel Telescope.

image

68

  • No matching results...
  • Searching...

/ 1000