跳到主要內容

在 Laravel 印出所有執行的 SQL 語句

在 routes.php 加入以下程式,就可顯示執行的SQL語句


<?php
...

Event::listen('illuminate.query', function($query)
{
    var_dump($query);
});

...
?>

參考來源:http://laravel-tricks.com/tricks/display-all-sql-executed-in-eloquent

留言

這個網誌中的熱門文章

What is phpize

What is phpize According to the PHP official document : The phpize command is used to prepare the build environment for a PHP extension. If you need to build such an extension that from github or another code repositories, you can use  build tools to perform the build manually.