Laravel 4 SQL log / console

后端 未结 8 2192
感动是毒
感动是毒 2020-12-31 05:50

Is there something similar in Laravel that allows you to see the actual SQL being executed? In Rails, for example, you can see the SQL in console. In Django you have a tool

8条回答
  •  無奈伤痛
    2020-12-31 05:59

    Here is a quick Javascript snippet you can throw onto your master page template. As long as it's included, all queries will be output to your browser's Javascript Console. It prints them in an easily readable list, making it simple to browse around your site and see what queries are executing on each page.

    When you're done debugging, just remove it from your template.

    
    

提交回复
热议问题