Magento, Laravel, Eloquent.
public function show(Category $category) { $category->load('products.category'); // eager load the products return view('categories.show', ['category' => $category]); } Now the N+1 issue is solved, but we are making two SQL queries to fetch the same category, once when the model gets injected into