Leave History - {{ $worker->name }}
@if(empty($monthlySplitLeaves))

No leaves recorded for this employee.

@else
Total Leave Taken in {{ now()->format('F Y') }} - {{ $totalLeaveThisMonth }} days
@php $groupedLeaves = collect($monthlySplitLeaves) ->sortByDesc(function ($leave) { return \Carbon\Carbon::parse($leave['month']); }) ->groupBy('month'); @endphp @foreach($groupedLeaves as $month => $leaves) @foreach($leaves as $leave) @endforeach @endforeach
{{ $month }}
Month Leave Type Start Date End Date Days in Month Half Day Reason
{{ $leave['month'] }} {{ ucfirst($leave['leave_type']) }} {{ \Carbon\Carbon::parse($leave['start_date'])->format('d/m/Y') }} {{ \Carbon\Carbon::parse($leave['end_date'])->format('d/m/Y') }} {{ $leave['days_in_month'] }} {{ $leave['is_half_day'] ? 'Yes' : 'No' }} {{ $leave['reason'] }}
@endif