Home>

I want to see the contents of sql with the following code, but I cannot use toSql () or DB :: enableQueryLog ().

User :: nullDeleteAt ()->approve ()->with (['userProject'])->notificationOrProjectUserId (Auth :: id ())->get ()->toArray ();

Error example

$hoge = User :: nullDeleteAt ()->approve ()->with (['userProject'])->notificationOrProjectUserId (Auth :: id ())->toSql ();
dd ($hoge);
DB :: enableQueryLog ();
User :: nullDeleteAt ()->approve ()->with (['userProject'])->notificationOrProjectUserId (Auth :: id ())->get ()->toArray ();
dd (DB :: getQueryLog ());