{{--
--}} {{--
--}} {{-- @if (session()->has('success'))--}} {{--
{{ session('success') }}
--}} {{-- @endif--}} {{-- @if (session()->has('error'))--}} {{--
{{ session('error') }}
--}} {{-- @endif--}} {{--
Manage Breaks
--}} {{-- @if ($currentBreak)--}} {{--

Current Break Started At: {{ $currentBreak->break_start }}

--}} {{-- --}} {{-- @else--}} {{-- --}} {{-- @endif--}} {{--
--}} {{--
--}}
TODAY BREAKS
@if ($currentBreak) @else @endif
@php $totalSeconds = 0; @endphp @foreach($todayBreaks as $br) @php $duration = breakTimeConvert($br->break_start, $br->break_end); // Parse the duration string "0 h 39 m 13 s" preg_match('/(\d+)\s*h\s*(\d+)\s*m\s*(\d+)\s*s/', $duration, $matches); if (count($matches) === 4) { $hours = (int)$matches[1]; $minutes = (int)$matches[2]; $seconds = (int)$matches[3]; $durationInSeconds = ($hours * 3600) + ($minutes * 60) + $seconds; $totalSeconds += $durationInSeconds; } @endphp @endforeach
Start Time Close Time Duration
{{ date('h:i:s A',strtotime($br->break_start))??'-' }} {{$br->break_end? date('h:i:s A',strtotime($br->break_end)):'-'}} {{$duration}}
Total Break Time @php $totalHours = floor($totalSeconds / 3600); $remainingSeconds = $totalSeconds % 3600; $totalMinutes = floor($remainingSeconds / 60); $finalSeconds = $remainingSeconds % 60; echo "{$totalHours} h {$totalMinutes} m {$finalSeconds} s"; @endphp