/**
  * @param int    $id
  * @param string $slug
  *
  * @throws \Illuminate\Database\Eloquent\ModelNotFoundException
  *
  * @return View|RedirectResponse
  */
 public function viewCategory(int $id, string $slug)
 {
     /** @var Category $category */
     $category = $this->category->findOrFail(Category::privateId($id));
     if ($category->slug() !== $slug) {
         return $this->webUi->redirect('categories.view', [$category->id, $category->slug()]);
     }
     $tree = $category->getDescendantsAndSelf()->load(['products' => function ($query) {
         /* @var Product $query */
         $query->with(Product::standardRelations());
     }]);
     return $this->webUi->view('customer.category.view', compact('category', 'tree'));
 }