public function db(Request $request)
{
$uid = $request->get('uid', 3);
Db::table('user')->where('id', $uid)->dd();
}
问题:
Error: Call to undefined function Illuminate\Database\Query\dd()
换成dump
也是没啥用.
对应的包
"require": {
"php": ">=7.2",
"workerman/webman-framework": "^1.3.14",
"monolog/monolog": "^2.0",
"psr/container": "v1",
"illuminate/database": "^7.30",
"illuminate/pagination": "^7.30",
"illuminate/events": "^7.30"
}
composer require symfony/var-dumper
安装下
composer require symfony/var-dumper
可以的
在想要获取的sql后面使用Db::table('***')->getLastSql();也可以获取整句sql。