renderStorefront($request, $this->ownedStore($request, $slug), [ 'type' => 'page', 'pageId' => PlanSchema::HOME_PAGE, ]); } /** * The shop page: every product shoppers may see. */ public function shop(Request $request, string $slug): Response { return $this->renderStorefront($request, $this->ownedStore($request, $slug), ['type' => 'shop']); } /** * One product's own page. */ public function product(Request $request, string $slug, string $productSlug): Response { $store = $this->ownedStore($request, $slug); $product = $store->products()->active()->with('images')->where('slug', $productSlug)->firstOrFail(); return $this->renderStorefront($request, $store, ['type' => 'product', 'product' => $product->toStorefront()]); } }