Exemplo n.º 1
0
 public function getCaffeine()
 {
     $nutrient = $this->nutrients()->whereNutrientId(Nutrient::Caffeine()->getID())->first();
     return $nutrient != null ? $nutrient->pivot->amount_in_food : 0;
 }