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
Use the below code to print RAW SQL in Laravel:
echo ""; print_r($query->toSql()); print_r($query->getBindings());
"; print_r($query->toSql()); print_r($query->getBindings());
Adding a PRE tag helps you read the result more accurately.