Skip to content

Commit 7b3a4f8

Browse files
authored
Merge pull request #214 from cluebattery/master
Laravel may return either an object or a collection. If laravel-model…
2 parents 0e040fe + 789afe6 commit 7b3a4f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/CachedBuilder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public function find($id, $columns = ["*"])
6161
}
6262

6363
$idKey = collect($id)->implode('-');
64-
$cacheKey = $this->makeCacheKey($columns, null, "-find_{$idKey}");
64+
$preStr = is_array($id) ? 'find-list' : 'find';
65+
$cacheKey = $this->makeCacheKey($columns, null, "-" . $preStr . "_{$idKey}");
6566

6667
return $this->cachedValue(func_get_args(), $cacheKey);
6768
}

0 commit comments

Comments
 (0)