DEV Community

Cover image for The best way to debug an eloquent query(Laravel)
Mohammad ALi Abd Alwahed
Mohammad ALi Abd Alwahed

Posted on

The best way to debug an eloquent query(Laravel)

The best way to debug an eloquent query and enhance it is to turn it to SQL
The most simple way to do that is by adding toSql at the end of our query same as the example in the photo attached below

Image description

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay