Magento, Laravel, Eloquent.
our model. However, let’s assume that we want to show all the products for a given category, our controller would look something like this: public function show(Category $category) { $category->load('products'); // eager load the products return view('categories.show', ['category' => $category]); }