src/PeskyCMF/Db/Traits/CacheHelpersTrait.php
public function cachedData($baseKey, $minutes, \Closure $dataCallback, $cacheKeySuffix = '', $recache = false) {
        $cacheKay = $this->generateCacheKey($baseKey, $cacheKeySuffix);
        if ($recache) {
            \Cache::forget($cacheKay);
        }
        return \Cache::remember($cacheKay, $minutes, $dataCallback);
    }
public function cachedData($baseKey, $minutes, \Closure $dataCallback, $cacheKeySuffix = '', $recache = false) {
        $cacheKay = $this->generateCacheKey($baseKey, $cacheKeySuffix);
        if ($recache) {
            \Cache::forget($cacheKay);
        }
        return \Cache::remember($cacheKay, $minutes, $dataCallback);
    }
Return data cached via $callback call
@param string|array $baseKey - use method name; array - will be jsoned and hashed
@param int|\DateTime $minutes
@param \Closure $dataCallback
@param string|array|null $cacheKeySuffix
@param bool $recache - true: update cache forcefully
@return mixed
@throws \UnexpectedValueException
@throws \RuntimeException
@throws \PeskyORM\Exception\OrmException
@throws \InvalidArgumentException
@throws \BadMethodCallException