列印sql語句,直接在你執行SQL語句後輸出 方法一: $queries = DB::getQueryLog(); $a = end($queries); $tmp = str_replace('?', '"'.'%s'.'"', $a["query"]); echo vsprintf($tmp, ...
列印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);
});