app('db')->connection()->enableQueryLog(); // 要执行的sql $sql = app('db')->getQueryLog(); var_dump($sql);