你可以做到这一点:
$query = DB::table('brands')
->join('products','a','=','c')
->whereNull('whatever');
echo $query->toSql();
But Laravel will not show you parameters in your query, because they are bound after preparation of the query.
So you can also do:
print_r( $query->getBindings() );