public function getVitaminC() { $nutrient = $this->nutrients()->whereNutrientId(Nutrient::VitaminC()->getID())->first(); return $nutrient != null ? $nutrient->pivot->amount_in_food : 0; }