Skip to content

Commit 9161c7c

Browse files
committed
array serialization for cache keys.
1 parent fcb3024 commit 9161c7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Repositories/CacheDecorator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(PlaceInterface $repo, CacheInterface $cache)
2727
*/
2828
public function byPage($page = 1, $limit = 10, array $with = ['translations'], $all = false)
2929
{
30-
$cacheKey = md5(config('app.locale').'byPage.'.$page.$limit.$all.implode('.', Request::except('page')));
30+
$cacheKey = md5(config('app.locale').'byPage.'.$page.$limit.$all.serialize(Request::except('page')));
3131

3232
if ($this->cache->has($cacheKey)) {
3333
return $this->cache->get($cacheKey);
@@ -51,7 +51,7 @@ public function byPage($page = 1, $limit = 10, array $with = ['translations'], $
5151
*/
5252
public function all(array $with = ['translations'], $all = false)
5353
{
54-
$cacheKey = md5(config('app.locale').'all'.$all.implode('.', $with).implode('.', Request::all()));
54+
$cacheKey = md5(config('app.locale').'all'.$all.serialize($with).serialize(Request::all()));
5555

5656
if ($this->cache->has($cacheKey)) {
5757
return $this->cache->get($cacheKey);

0 commit comments

Comments
 (0)