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

前端 未结 4 1074
野的像风
野的像风 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:01

    Use the below code to print RAW SQL in Laravel:

    echo "
    ";
    print_r($query->toSql());
    print_r($query->getBindings());
    

    Adding a PRE tag helps you read the result more accurately.

提交回复
热议问题