在框架中找到AppServiceProvider.php這個文件,在該函數的boot方法中添加一下代碼,就可以在日誌中查看執行過的sql語句
\DB::listen(function (QueryExecuted $event) {
dump($event->sql, $event->bindings);
});
在框架中找到AppServiceProvider.php這個文件,在該函數的boot方法中添加一下代碼,就可以在日誌中查看執行過的sql語句
\DB::listen(function (QueryExecuted $event) {
dump($event->sql, $event->bindings);
});