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
Just to reiterate @giovannipds great answer... i'm doing like this:
vsprintf(str_replace(['?'], ['\'%s\''], $query->toSql()), $query->getBindings())