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)