Skip to content

Commit

Permalink
Add support for cache tags param (#3357)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell authored Apr 6, 2021
1 parent 3e3983f commit 1196577
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Tags/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ public function index()
return [];
}

if ($cached = LaraCache::get($key = $this->getCacheKey())) {
$store = LaraCache::store();

if (count($tags = $this->params->explode('tags', []))) {
$store = $store->tags($tags);
}

if ($cached = $store->get($key = $this->getCacheKey())) {
return $cached;
}

LaraCache::put($key, $html = (string) $this->parse([]), $this->getCacheLength());
$store->put($key, $html = (string) $this->parse([]), $this->getCacheLength());

return $html;
}
Expand Down

0 comments on commit 1196577

Please sign in to comment.