This forum is in read-only mode. Please continue to browse, but replying and other actions are disabled for now.

domjag
domjag

I added a second pivot table to my model. I am trying to access both pivots in the same loop like so:

      {% for mealitem in list.mealitems %}

     <h2 class="mcx"> {{mealitem.name}} </h2>
      <h4 class="ui sub header">{{mealitem.pivot.choice_type}}</h4> (Pivot relation is called 'MealType' here)

Now I need to loop through my second pivot table

                                            ??     {{mealitem.pivot.nutrion.name}} (Pivot relation is called 'Nutrition' and belongs to same model as 'Meal Type')

So how do I access this second relation in TWIG?

1-1 of 1

You cannot edit posts or make replies: the forum is disabled.