Laravel中是否有类似的东西可以让您看到正在执行的实际SQL? 例如,在Rails中,您可以在控制台中看到SQL.在Django中,您有一个工具栏.
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 toolbar.
Laravel 4中有类似的东西吗?
Is there something like that in Laravel 4?
澄清一下:我的问题是如何在没有代码的情况下做到这一点.是否有Laravel内置的不需要我在应用程序中编写代码的东西?
To clarify: My question is how to do it without code. Is there something that is built-in in Laravel that does not require me to write code in app?
更新:最好我也希望看到CLI查询(例如php artisan migrate)
UPDATE: Preferably I'd like to see CLI queries as well (for example php artisan migrate)
推荐答案如果您使用的是Laravel 4,请使用以下方法:
If you are using Laravel 4, use this:
$queries = DB::getQueryLog(); $last_query = end($queries);更多推荐
Laravel 4 SQL日志/控制台
发布评论