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
![Cover image for The best way to debug an eloquent query(Laravel)](https://media.dev.to/cdn-cgi/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3v45rahxoxu6zi0ps9u6.png)
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)