WebLinuxStudy

导航

 

laravel打印完整SQL语句

用DB自带的getQueryLog方法直接打印:

//开启QueryLog
DB::connection()->enableQueryLog();

\App\User::find(1);

dump(DB::getQueryLog());

 

posted on 2021-06-09 17:46  WebLinuxStudy  阅读(54)  评论(0编辑  收藏  举报