I'm currently organising the third edition Full Stack Europe. It's a conference in Antwerp, Belgium in October for developers who want to learn across the stack. We have a great line up with lots of familiar faces! Register your ticket now!

How to get query builder to output its raw SQL query as a string in Laravel?

Link – postsrc.com - submitted by Sir Src

Learn how to get the raw SQL string from a query builder in Laravel the easy way. Get to know this information to inspect the query used to retrieve the data.

You could also use ray($query) to see the query in Ray.

Read more [postsrc.com]

Stay up to date with all things Laravel, PHP, and JavaScript.

You can follow me on these platforms:

On all these platforms, regularly share programming tips, and what I myself have learned in ongoing projects.

Every month I send out a newsletter containing lots of interesting stuff for the modern PHP developer.

Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.

Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.


What are your thoughts on "How to get query builder to output its raw SQL query as a string in Laravel?"?

Comments powered by Laravel Comments
Want to join the conversation? Log in or create an account to post a comment.