Clear
@foreach($foodConsumptions as $group) @php $first = $group->first(); $noteKey = $first->consumed_at->format('Y-m-d').'_'.$first->meal_type; $note = $mealNotes[$noteKey]->note ?? '-'; @endphp {{-- @endforeach
ID Date Meal Food Unit Quantity Grams Calories Protein Carbs Fat Note
{{ $loop->iteration }} {{ $first->consumed_at?->format('d-m-Y') ?? '-' }} {{ $first->mealType?->mt_value ?? '-' }} @foreach($group as $food)
{{ $food->food?->name ?? '-' }}
@endforeach
@foreach($group as $food)
{{ $food->unitMasterTable?->cu_value ?? '-' }}
@endforeach
@foreach($group as $food)
{{ $food->quantity ?? '-' }}
@endforeach
@foreach($group as $food)
{{ $food->grams ?? '-' }}
@endforeach
@foreach($group as $food)
{{ $food->total_calories ?? '-' }}
@endforeach
@foreach($group as $food)
{{ $food->protein ?? '-' }}
@endforeach
@foreach($group as $food)
{{ $food->carbs ?? '-' }}
@endforeach
@foreach($group as $food)
{{ $food->fat ?? '-' }}
@endforeach
--}} {{-- --}} @if($note != '-') @else - @endif {{--
@if($note != '-') {{ $note }} @else No note added @endif
--}}
{{-- --}}