protected function getContentFromCache()
    {
        $cache_key = $this->widget->cacheKey();
        $cache_time = $this->widget->cacheTime();

        // Check the existence of the cache.
        if (! cache()->has($cache_key)) {
            // If cache is empty and validation is fails.
            $this->checkWidgetParams();
            // If cache is empty and template file does not exists.
            $this->checkWidgetTemplate();
        }

        return cache()->remember($cache_key, $cache_time, function () {
            return $this->getContent();
        });
    }
protected function getContentFromCache()
    {
        $cache_key = $this->widget->cacheKey();
        $cache_time = $this->widget->cacheTime();

        // Check the existence of the cache.
        if (! cache()->has($cache_key)) {
            // If cache is empty and validation is fails.
            $this->checkWidgetParams();
            // If cache is empty and template file does not exists.
            $this->checkWidgetTemplate();
        }

        return cache()->remember($cache_key, $cache_time, function () {
            return $this->getContent();
        });
    }
protected function getContentFromCache ( ) { $ cache_key = $ this -> widget -> cacheKey ( ) ; $ cache_time = $ this -> widget -> cacheTime ( ) ; // Check the existence of the cache. if ( ! cache ( ) -> has ( $ cache_key ) ) { // If cache is empty and validation is fails. $ this -> checkWidgetParams ( ) ; // If cache is empty and template file does not exists. $ this -> checkWidgetTemplate ( ) ; } return cache ( ) -> remember ( $ cache_key , $ cache_time , function ( ) { return $ this -> getContent ( ) ; } ) ; }
Gets content from cache or runs widget class otherwise.

@return mixed
Gets content from cache or runs widget class otherwise .