@php use Carbon\Carbon; $highlightMonth = isset($month) ? (int)$month : Carbon::now()->month; $months = ['Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre']; @endphp @foreach($months as $index => $month) @php $m = $index + 1; if ($m < $highlightMonth) { $thStyle = 'background-color: #b5e6a2;'; } elseif ($m == $highlightMonth) { $thStyle = 'background-color: #ffff00;'; } else { $thStyle = ''; } @endphp @endforeach @foreach($tableData as $row) @for($m = 1; $m <= 12; $m++) @php $monthValue = $row['months'][$m] ?? ''; $tdStyle = ($m == $highlightMonth) ? 'background-color: #ffff00;' : ''; @endphp @endfor @endforeach
Nom & Prénom En jours ANNÉE {{ $start->format('Y') }} Total
DROIT
{{ $start->format('Y') }}
{{ $month }}
{{ $row['lastname'] }} {{ $row['firstname'] }} {{ $row['nbrHolidays'] }}{{ $monthValue }}{{ $row['totalDays'] }}