private function getWidgetCacheParams(Widget $widget) { $key = []; foreach ($widget->cacheKeyDependences() as $dependence) { $key[] = $this->getHashKeyDependences($dependence); } $models = array_pluck($key, 'model'); return array_filter($models); }
/** * Determine if the given widget has been cached. * * @param \ZEDx\Widget $widget * * @return bool */ public function hasCached(Widget $widget) { if (!env('APP_CACHE', true)) { return false; } if (!$widget->cache()) { return false; } return $this->cache->has($this->hasher->getHashForWidget($widget)); }