Have a look at https://github.com/itsgoingd/clockwork or https://github.com/barryvdh/laravel-debugbar
These are chrome extensions and will log db queries for you and present them in developertools.
Hi, I am building an application using Laravel 5.1. I am trying I use Eloquent as an ORM to interact with my database.
One of the things that I am having difficulties with is trying to identify the source of each query being generated my Eloquent.
Trying I understand what is being executed at the server, I turn on MySQL general log and log it to a table "for easy access." However, I got 36 queries being exexuted from a single page refresh "this is a red flag in my mind."
The challenge here is how to know what job/what at what point in my code was each query generated?
I want to make sure I don't sacrafy DB performance because I am trying to use Eloquent.
How can I drill down the source of each query?
Does Eliquent have its own log? If so where do I find it? If not how would I know what is generating these queries?
It would be very nice if Eloquent have its own general logs like MySQL. I would be a dream come true if the eloquent log would tell me at what point in my code query x was executed. To take this thought further, it will be yet more powerful if the queries are logged in a general format where one can get stats on how many time query x was generated regardless of the vales passes to it. It will help to know if query x was cached by the application or not.
Thank you for your help.
Please or to participate in this conversation.