public static function getFromCache($id, $type)
{
$cache = Cache::get($type);
if (!$cache) {
static::logError("Cache for {$type} is not set");
return null;
}
$data = $cache->filter(function ($item) use($id) {
return $item->id == $id;
});
return $data->first();
}