Skip to content

Commit

Permalink
Update QueryableBlock.php
Browse files Browse the repository at this point in the history
Change logic for 'in' to be more intuitive and added 'has' (similar to how 'in' was)
  • Loading branch information
wildwalks authored Oct 11, 2024
1 parent 7d81e68 commit d08a7f8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Traits/QueryableBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,8 @@ public function where(
'<=' => $elementToCheck->get($field) <= $value,
'!=' => $elementToCheck->get($field) != $value,
'!==' => $elementToCheck->get($field) !== $value,
'like' => self::like($elementToCheck->get($field), $value),
'in' => (is_array($elementToCheck->get($field)) && is_string($value)
? in_array($value, $elementToCheck->get($field))
: in_array($elementToCheck->get($field), $value)
),
'in' => in_array($value, $elementToCheck->get($field)),
'has' => in_array($elementToCheck->get($field), $value),
default => $elementToCheck->get($field) === $value,
};
if ($found) {
Expand Down

0 comments on commit d08a7f8

Please sign in to comment.