FreeLightman
FreeLightman

Reputation: 2304

Laravel get sql query with argument bindings

enter image description here

I have build a query which then will be used as subquery. So it is needed to be transfromed to sql. When I call toSql method it shows me such sql query

"select * from `product_variant_values` where 
(`option_id` = ? and `value_id` = ?)
 or (`option_id` = ? and `value_id` = ?) 
or (`option_id` = ? and `value_id` = ?)"

But I want so that instead of ? signs there will be real arguments. How can I do this?

Upvotes: 1

Views: 609

Answers (2)

Chung
Chung

Reputation: 975

just a cheating way.

You can edit your query to get a syntax error. You can see your query with all arguments

Upvotes: 0

Ezequiel Moreno
Ezequiel Moreno

Reputation: 2348

You cannot obtain the SQL with the prepared values filled. You may use getBindings for obtaining the values and replacing it in your query.

Upvotes: 2

Related Questions