Replies: 2 comments 2 replies
-
Could you put up a public repo with just enough code to display this issue? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Why not to use dynamic scopes? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a Message Model with a custom Query Builder:
The Model Query Builder is:
This method returns the error:
The problem is the third parameter in
where
, because is filled with the default Database Builder, instead the current Model Builder.Following the framework code, I get:
The
where
is moved from Eloquent to default Query builder:framework/src/Illuminate/Database/Eloquent/Builder.php
Lines 290 to 301 in 81c61bd
Now the Query Builder is the default:
framework/src/Illuminate/Database/Query/Builder.php
Lines 794 to 799 in 81c61bd
And here where the Callback is called:
framework/src/Illuminate/Database/Query/Builder.php
Lines 1660 to 1663 in 81c61bd
The only way that I have to fix this is creating the query using the Database Builder:
There are some more "Elegant" solution?
Thanks!
Lito.
Beta Was this translation helpful? Give feedback.
All reactions