@if ($attentionsByEstpId != null && count($attentionsByEstpId) > 0)
@foreach ($attentionsByEstpId as $attention)
@php
// Validamos si la fecha tiene un valor real, si no, le asignamos null
$fechaMax = !empty($attention['ce_fecha_max']) ? $attention['ce_fecha_max'] : null;
// Si hay fecha, la parseamos de forma segura; si no, dejamos $maxima como null
$maxima = $fechaMax ? \Carbon\Carbon::parse($fechaMax)->startOfDay() : null;
@endphp