Larave 4.2 cache not putting data
I am working in laraval v4.2 and I want to put an array into cache but when I get data from cache then it return false all the time and cache has no data. Below is my working code
$posts = array(
     [0] => 2365
     [1] => 2366
     [2] => 2367
     [3] => 2368
     [4] => 2369
);
$time = 60;
Cache::put('views-87',$posts,$time);
$data = self::getPostsFromCache('views-87');
public static function getPostsFromCache($key){
     if(Cache::has($key)){
          return Cache::get($key);
     }
     return array();
}
Result
empty Array()
Kindly guide in right direction
from Laravel Questions and Answers https://laravelquestions.com/laravel/larave-4-2-cache-not-putting-data/
via Lzo Media
No comments:
Post a Comment