Laravel Eloquent ORM获取执行的SQL语句的方法:
//先引用DB类
use Illuminate\Support\Facades\DB;
//然后在要获取SQL的模型代码前后加上下面的代码
DB::enableQueryLog();
$user = User::find(1);
dd(DB::getQueryLog());
(adsbygoogle = window.adsbygoogle || []).push({});
来源:https://www.02405.com/archives/1890