Magento, Laravel, Eloquent.
the show method in the controller and the other when we call the load method on that category. Fortunately, there is a way to avoid that by assigning the relationship directly using the setRelation method. public function show(Category $category) { $category->products->each->setRelation('category',