标签:
打印sql语句,直接在你执行SQL语句后输出
方法一:
$queries = DB::getQueryLog();
$a = end($queries);
$tmp = str_replace(‘?‘, ‘"‘.‘%s‘.‘"‘, $a["query"]);
echo vsprintf($tmp, $a[‘bindings‘]);
exit;
方法二: 注意 放在routes.php上面
Event::listen(‘illuminate.query‘,function($query){
var_dump($query);
});
标签:
原文地址:http://www.cnblogs.com/maixiansheng/p/5530578.html