@if (!empty($sample->commentary))

{{ $sample->commentary }}

@endif @php $defaultComments = $sample->default_comments ?? []; if (is_string($defaultComments)) { $defaultComments = json_decode($defaultComments, true) ?: []; } if (!is_array($defaultComments)) { $defaultComments = []; } @endphp @if (!empty($defaultComments)) @foreach ($defaultComments as $comment) @php $defaultComment = data_get($comment, 'comment_text') ?: data_get($comment, 'standard_comment'); $causeCode = data_get($comment, 'cause_code'); $consequenceText = data_get($comment, 'consequence_text') ?: data_get($comment, 'technical_consequence'); @endphp @if (!empty($defaultComment))

{{ $defaultComment }} @if (!empty($causeCode))
Causa: {{ $causeCode }} @endif @if (!empty($consequenceText))
Consecuencia: {{ $consequenceText }} @endif

@endif @endforeach @endif @if (!empty($dynamicCauseComment))

{{ data_get($dynamicCauseComment, 'standard_comment') }} @if (!empty(data_get($dynamicCauseComment, 'cause_code')))
Causa: {{ data_get($dynamicCauseComment, 'cause_code') }} @endif @if (!empty(data_get($dynamicCauseComment, 'consequence_text')))
Consecuencia: {{ data_get($dynamicCauseComment, 'consequence_text') }} @endif

@endif @if (empty($sample->commentary) && empty($defaultComments) && empty($dynamicCauseComment)) Sin comentario @endif