Skip to content

Commit 4cfba48

Browse files
committed
Fix CachedBuilder::pluck key generation
1 parent d3ecb40 commit 4cfba48

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/CachedBuilder.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,8 @@ public function pluck($column, $key = null)
147147
return parent::pluck($column, $key);
148148
}
149149

150-
$cacheKey = $this->makeCacheKey([$column], null, "-pluck_{$column}");
151-
152-
if ($key) {
153-
$cacheKey .= "_{$key}";
154-
}
150+
$keyDifferentiator = "-pluck_{$column}" . ($key ? "_{$key}" : "");
151+
$cacheKey = $this->makeCacheKey([$column], null, $keyDifferentiator);
155152

156153
return $this->cache($this->makeCacheTags())
157154
->rememberForever($cacheKey, function () use ($column, $key) {

0 commit comments

Comments
 (0)