I want to print my query on laravel and my query is
DB::table('avt_channel_billing_address')->where('channel_id',$channel_id)->update($channelList)
where $channel is an array of values.
I tried using dd(DB::getQueryLog())
and toSql
.None print the query.
DB::enableQueryLog();
DB::table('avt_channel_billing_address')->where('channel_id',$channel_id)->update($channelList)
dd(DB::getQueryLog())
Docs
$query = User::select("*")->toSql();
dd($query);
Another way:
DB::enableQueryLog();
$users = User::select("*")->get();
$quries = DB::getQueryLog();
dd($quries)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With