Replies: 1 comment 2 replies
-
Did you ever solve this? I think it would be helpful for solving my issue too: #112 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to ask if there what i am asking below it is implemented already (which I am missing clearly) or need to implement it.
In modelScope() method in src>SchemalessAttributes, we have the modelScope() method, which builds the query to search a value in the attributes.
I wanted to chain multiple WHEREs , instead of making a separate query for each attribute (and then combining the results) , i wanted to do.
foreach ($this->allResourceAttributes as $attribute) { $modelAttributeQuery->withExtraAttributes($attribute, 'LIKE', '%' . $this->search . '%'); }
Deep down in the modelScope i see that it says
$builder->where("{$this->sourceAttributeName}->{$name}", $operator ?? '=', $value)
This is going to do a
SELECT * from Model WHERE attribute LIKE value AND attribute LIKE value AND etc...
(simplified the statement here , there is much json work here)My goal is achieved is achieved if I switch the
where
toorWhere
. I wanted to ask , is the package implementing this orWhere somehow else ?Thank you in advance for your time to respond , much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions