2016-10-10 64 views
0

我试图用remember方法实现laravel的缓存。那么,我该如何实现永久性呢?我尝试通过0null分钟,但它不起作用。Laravel5 - Cache ::永远记住

我想缓存被存储,直到其撤销我的代码(即永远)。

感谢

回答

0

只需拨打Cache::forever('key','value')

+0

在'永远'没有'closure' –

0

我发现自己是用rememberForever答案。像这样:

$my_data = Cache::rememberForever('key_123', function(){ 
//fetch from db and add to cache if not found 
}