Using QueryBuilder as scope in a model #908
Replies: 1 comment
-
Ah, I figured out that there is no problem with using it as a scope. The problem was related to sorting. There is no support to sort a column with a related column directly. I fixed my issue, and this was helpful. #36 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi folks,
I want to ask this:
I have a trait called Filterable, and it has a scope. It looks like this:
I want to use it like this:
It works perfectly on a non-related field, but when I tried to filter or sort on a related field, it won't work. It puts my filter into the main query instead of the related model.
Here is the SQL output:
Is it a bug, or I can't use it like this?
Any Idea?
Beta Was this translation helpful? Give feedback.
All reactions