在laravel中打印查询

在laravel中打印查询,laravel,laravel-5,laravel-4,Laravel,Laravel 5,Laravel 4,我想在laravel上打印我的查询,我的查询是 DB::table('avt\u channel\u billing\u address')->其中('channel\u id',$channel\u id)->update($channelList)其中$channel是一个值数组 我尝试使用dd(DB::getQueryLog())和toSql。没有人打印查询 DB::enableQueryLog(); DB::table('avt_channel_billing_address')->

我想在laravel上打印我的查询,我的查询是
DB::table('avt\u channel\u billing\u address')->其中('channel\u id',$channel\u id)->update($channelList)
其中$channel是一个值数组

我尝试使用
dd(DB::getQueryLog())
toSql
。没有人打印查询

DB::enableQueryLog();
DB::table('avt_channel_billing_address')->where('channel_id',$channel_id)->update($channelList)
dd(DB::getQueryLog())

您可能必须打开它:
DB::enableQueryLog()
和than调用
DB::getQueryLog()

两者都应该可以工作。我刚刚试过并为我工作。@imrealashu我试过这个DB::table('avt_channel_billing_address')->where('channel_id',$channel_id)->update($channelList)->toSql();我已经贴出了答案。试一下。我在当地试过,效果不错。