Skip to content

Commit

Permalink
Add permanent cache.
Browse files Browse the repository at this point in the history
Store an item in the cache permanently.
  • Loading branch information
mingyoung committed Feb 20, 2017
1 parent 8701115 commit 5e4205a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CacheBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public function contains($id)
*/
public function save($id, $data, $lifeTime = 0)
{
if ($lifeTime == 0) {
return Cache::forever($id, $data);
}

return Cache::put($id, $data, $lifeTime / 60);
}

Expand Down

0 comments on commit 5e4205a

Please sign in to comment.