📜  laravel 打印生成器 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:33.303000             🧑  作者: Mango

代码示例1
// query builder
$query = DB::table('table_name')->where('id', 1);
// binding replaced
$rawQuery = str_replace_array('?', $query->getBindings(), $query->toSql());
// for laravel 5.8^
$rawQuery = Str::replaceArray('?', $query->getBindings(), $query->toSql());
 
dd($rawSql); // "select * from `table_name` where `id` = 1";