/** * @param Product $product * * @throws \BadMethodCallException * * @return string */ public function productMeta(Product $product) : string { $key = "product.{$product->id}.meta"; if ($this->cacheHas($key)) { return (string) $this->cacheGet($key); } $product->loadStandardRelations(); $content = $this->viewFactory->make('customer.product.meta', compact('product'))->render(); $this->cachePut($key, $content, Carbon::now()->addDays(7)); return $content; }