diff --git a/src/Tags/Concerns/QueriesConditions.php b/src/Tags/Concerns/QueriesConditions.php index 87750c4de4..ea3effebf0 100644 --- a/src/Tags/Concerns/QueriesConditions.php +++ b/src/Tags/Concerns/QueriesConditions.php @@ -72,6 +72,10 @@ protected function queryCondition($query, $field, $condition, $value) return $this->queryInCondition($query, $field, $value); case 'not_in': return $this->queryNotInCondition($query, $field, $value); + case 'includes': + return $this->queryIncludesCondition($query, $field, $value); + case 'doesnt_include': + return $this->queryDoesntIncludeCondition($query, $field, $value); case 'starts_with': case 'begins_with': return $this->queryStartsWithCondition($query, $field, $value); @@ -161,6 +165,16 @@ protected function queryNotInCondition($query, $field, $value) return $query->whereNotIn($field, $value); } + protected function queryIncludesCondition($query, $field, $value) + { + return $query->whereJsonContains($field, $value); + } + + protected function queryDoesntIncludeCondition($query, $field, $value) + { + return $query->whereJsonDoesntContain($field, $value); + } + protected function queryStartsWithCondition($query, $field, $value) { return $query->where($field, 'like', "{$value}%");