{{ __(":name's Journal", ['name' => Auth::user()->name]) }}

@if(session()->has('message'))
{{ session()->get('message') }}
@endif

{{ $date->format('D, j M Y') }}

{{ $entries->count() }} {{ \Illuminate\Support\Pluralizer::plural('entry', $entries->count()) }}
Calories
{{ round($entries->sum('calories'), 2) }}g
Fat
{{ round($entries->sum('fat'), 2) }}g
Cholesterol
{{ round($entries->sum('cholesterol'), 2) }}g
Sodium
{{ round($entries->sum('sodium'), 2) }}g
Carbohydrates
{{ round($entries->sum('carbohydrates'), 2) }}g
Protein
{{ round($entries->sum('protein'), 2) }}g
@foreach(['breakfast', 'lunch', 'dinner', 'snacks'] as $meal)

{{ Str::ucfirst($meal) }} @foreach($nutrients as $nutrient) {{ round($entries->where('meal', $meal)->sum($nutrient), 2) }}g {{ $nutrient }}@if(!$loop->last), @endif @endforeach

@forelse($entries->where('meal', $meal) as $entry)
{{ $entry->summary }}
nutrients: @foreach($nutrients as $nutrient) {{ round($entry->{$nutrient}, 2) }}g {{ $nutrient }}@if(!$loop->last), @endif @endforeach
@if($entry->foods()->exists())
foods: @foreach($entry->foods as $food) {{ $food->name }}@if(!$loop->last), @endif @endforeach
@endif @if($entry->recipes()->exists())
recipes: @foreach($entry->recipes as $recipe) {{ $recipe->name }}@if(!$loop->last), @endif @endforeach
@endif
@empty No entries. @endforelse
@endforeach