/** * Render the block * @param Block $block The block to be rendered * @return string The rendered view of the block or raw text */ public function render(Block $block) { if (!$this->cache) { return $block->render(); } return $this->cache->remember('larablock.' . $block->getName(), config('larablock.cache_ttl'), function () use($block) { return $block->render(); }); }
/** * Create a new session in storage. * * @param string $id * @param array $session * @param Symfony\Component\HttpFoundation\Response $response * @return void */ public function createSession($id, array $session, Response $response) { $this->cache->forever($id, $session); }