@extends('layouts/eatvio') @section('main_section') @php $curMeals = $curDiary->meals()->orderBy('type')->get(); $typeNames = ['Завтрaк', 'Обед', 'Ужин', 'Ланч', 'Перекусы']; $commentTypes = ['breakfast', 'dinner', 'supper', 'lunch', 'snacks', 'wakeup_time', 'total']; $hasComments = $curDiary->hasComments; $comments = $curDiary->consultant_comments()->pluck('comment', 'comment_type'); @endphp
Календарь
{{ $curDiary->date }}

Проснулись

{{ $curDiary->wakeup }}

Легли спать

{{ $curDiary->retire }}
@if($hasComments)
{{ $comments->get('retire') }}
@endif
@foreach($curMeals as $key => $meal)

{{ $typeNames[$meal->type] }}

Сытность:{{ $meal->satiety }}
Настроение:{{ $meal->mood }}
{{ $meal->time }}
@if(count($meal->portions))
@foreach($meal->portions as $portion) @endforeach
{{ $portion->product_name }} {{ $portion->quantity }} {{ $portion->portion }}
@endif @if(count($meal->photos))
@foreach($meal->photos as $photo) @endforeach
@endif
@php $curComment = $comments->get($commentTypes[$meal->type]) @endphp @if( $curComment !== null)
{{ $curComment }}
@endif @endforeach

Дополнительная информация:

{{ $curDiary->comment ?? '' }}
@if($hasComments)
{{ $comments->get('total') }}
@endif
РЕДАКТИРОВАТЬ ДЕНЬ
@endsection