/** * Initialize the Option Class * build the Config array. * * @param StorageContract $storage The Database Interface * @param CacheContract $cache Laravel CacheContract */ public function __construct(StorageContract $storage, ConfigContract $config, CacheContract $cache) { $this->storage = $storage; $this->cache = $cache; $this->config = $config; $this->items = $cache->rememberForever('weboap.options', function () { return $this->storage->all(); }); }
/** * @return mixed */ public function all($collection = false) { $result = $this->cache->rememberForever('weboap.visitor', $this->storage->all()); if ($collection) { return $this->collection->make($result); } return $result; }