I'm using Laravel 5.2 and wants to cache eloquent results, but it does not store empty results (= null) on cache. Is there any way to do it?
return Cache::remember("cacheKey_{$id}", 120, function () use ($id) {
return FooModel::where(...)->first();
});
When the result is not empty, the cache is working properly.