Skip to content

Commit 227517c

Browse files
committed
- Skip adding currentBinding in the CacheKey class if the where values is not in the query binding.
1 parent 82be9a1 commit 227517c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/CacheKey.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ protected function getInAndNotInClauses(array $where) : string
234234
$type = strtolower($where["type"]);
235235
$subquery = $this->getValuesFromWhere($where);
236236
$values = collect($this->query->bindings["where"][$this->currentBinding] ?? []);
237-
$this->currentBinding += count($where["values"]);
237+
238+
if (Str::startsWith($subquery, $values->first())) {
239+
$this->currentBinding += count($where["values"]);
240+
}
238241

239242
if (! is_numeric($subquery) && ! is_numeric(str_replace("_", "", $subquery))) {
240243
try {

0 commit comments

Comments
 (0)