Reputation: 6013
Im trying to implement laravel's cache using the remember
method. So how do I implement a forever with this? I tried passing 0
or null
as minutes but it doesnt work.
I want the cache to be stored until its revoked my the code (i.e. forever).
Thanks
Upvotes: 2
Views: 1526
Reputation: 6013
The answer I found myself is to use rememberForever
. Like this:
$my_data = Cache::rememberForever('key_123', function(){
//fetch from db and add to cache if not found
}
Upvotes: 1