diff --git a/app/Models/Traits/HasIngredients.php b/app/Models/Traits/HasIngredients.php index 7017f2d..b6f16c1 100644 --- a/app/Models/Traits/HasIngredients.php +++ b/app/Models/Traits/HasIngredients.php @@ -36,7 +36,7 @@ trait HasIngredients */ private function sumNutrient(string $nutrient): float { $sum = 0; - foreach ($this->ingredients as $ingredientAmount) { + foreach ($this->ingredientAmounts as $ingredientAmount) { $sum += $ingredientAmount->{$nutrient}(); } return $sum;