laravel print builder

Solutions on MaxInterview for laravel print builder by the best coders in the world

showing results for - "laravel print builder"
Romy
30 Jul 2018
1// query builder
2$query = DB::table('table_name')->where('id', 1);
3// binding replaced
4$rawQuery = str_replace_array('?', $query->getBindings(), $query->toSql());
5// for laravel 5.8^
6$rawQuery = Str::replaceArray('?', $query->getBindings(), $query->toSql());
7 
8dd($rawSql); // "select * from `table_name` where `id` = 1";