laravel / ideas

Issues board used for Laravel internals discussions.
938 stars 28 forks source link

Add toSqlWithBindings() #2450

Closed zarpelon closed 3 years ago

zarpelon commented 3 years ago

Hey Sirs,

Today to debug a query and your bindings, we need to write:

dd($query->toSql(), $query->getBindings());

Is there a way to create specific method that your output is the SQL + bindings? Like $query->toSqlWithBindings()

Make sense?

crynobone commented 3 years ago

https://github.com/laravel/framework/blob/d30dbebba270034bbba1316f5c0fe7579bc20408/src/Illuminate/Database/Query/Builder.php#L3277-L3287

zarpelon commented 3 years ago

Tks @crynobone