webman查询构建器使用dd或dump报错(已解决)

wxvirus
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
1756 2 4
2个回答

walkor 打赏

安装下 composer require symfony/var-dumper

vvei

在想要获取的sql后面使用Db::table('***')->getLastSql();也可以获取整句sql。

  • 暂无评论
年代过于久远,无法发表回答
×
🔝