Does Laravel's toSql() method mask ids? (column value being replaced by question mark)

前端 未结 4 1066
野的像风
野的像风 2020-12-15 23:46

I\'m trying to debug some SQL queries that I\'m doing in a testing suite. Using the following debugging code:

\\Log::debug(User::first()->jobs()->toSql         


        
4条回答
  •  粉色の甜心
    2020-12-16 00:16

    Just to reiterate @giovannipds great answer... i'm doing like this:

    vsprintf(str_replace(['?'], ['\'%s\''], $query->toSql()), $query->getBindings())
    

提交回复
热议问题