Skip to content

why toSql() method is not available on some methods of queryBuilder #38750

Discussion options

You must be logged in to vote

These methods execute the query, they do not return a query builder instance.

If these methods returned a query builder instance you would need to somehow execute the query with an additional execute() call or something.

You can log the queries and inspect them if you want to see which sql query was executed by Laravel.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by crynobone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants