diff --git a/src/CacheKey.php b/src/CacheKey.php index cef259f..b88d9a0 100644 --- a/src/CacheKey.php +++ b/src/CacheKey.php @@ -234,7 +234,10 @@ protected function getInAndNotInClauses(array $where) : string $type = strtolower($where["type"]); $subquery = $this->getValuesFromWhere($where); $values = collect($this->query->bindings["where"][$this->currentBinding] ?? []); - $this->currentBinding += count($where["values"]); + + if (Str::startsWith($subquery, $values->first())) { + $this->currentBinding += count($where["values"]); + } if (! is_numeric($subquery) && ! is_numeric(str_replace("_", "", $subquery))) { try {