-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.8] Add the dd
method to the query builder
#28357
[5.8] Add the dd
method to the query builder
#28357
Conversation
The benefit of this is you can put the die dump at any point in the query build process (similar to how you can in a Collection chain). Normally you would have to assign it to a temporary variable (which isn't necessarily easy to do, depending on how complex your query is), and then run the This allows you to not have to change your code, just put |
dd
method to the query builderdd
method to the query builder
I would just add it to the underlying query builder class instead of making a trait. |
I'll be honest, I did that originally, then thought I had to add it to all of the individual relationships. When it turned out I didn't have to do that, I forgot to revert my changes. I'll make that change now. |
Done. |
I think we should name the method |
On Collections, the method is also called |
A |
|
Should this be on the Eloquent builder or the query builder? |
Please move the method to the query builder. This way, it is also available on the Eloquent builder. |
I'll move it to the Query builder so that both have it. @taylorotwell Any thoughts on |
Ok, thats changed. Now the Query Builder and Eloquent have both debug methods on them. |
Adds the
dd
helper to the query builder so that you can debug queries inline.Will show you the query and bindings.