@php $defaultAvatar = asset('storage/uploads/user-icon.png'); $punchFlag = fn (int $index, int $total) => match (true) { $index === 0 => __('In Time'), $index === $total - 1 && $total > 1 => __('Out Time'), $index % 2 === 0 => __('In Time'), default => __('Out Time'), }; $punchClass = fn (int $index, int $total) => match (true) { $index === 0, $index % 2 === 0 => 'in', default => 'out', }; @endphp @extends('admin.layouts.app') @section('title', get_setting('site_name').' | Attendance History') @section('content')

Attendance History

Raw punch logs from devices — grouped by day for each employee.

Filters Clear Filters

Employee is required. Empty dates default to the current month.

@if($show === null)
Select an employee

Choose staff and date range, then click Filter to load punch history.

@elseif($staff_details)
Punch History Report
@php $avatar = $staff_details->user?->image ? asset('storage/'.$staff_details->user->image) : $defaultAvatar; @endphp
@if(get_setting('system_logo_white')) {{ get_setting('site_name') }} @endif
{{ get_setting('site_name') }}
{{ get_setting('contact_address', null, App::getLocale()) }}
Attendance History Report
{{ \Carbon\Carbon::parse($startDate)->format('M d, Y') }} — {{ \Carbon\Carbon::parse($endDate)->format('M d, Y') }}
{{ $staff_details->user?->name ?? '—' }}
User ID: {{ $staff_details->user_id ?? '—' }} · Staff ID: {{ $staff_details->id }} · {{ $staff_details->designation?->name ?? 'No Designation' }}
{{ $staff_details->warehouse?->name ?? 'No Branch' }}
{{ $totalDays }}
Days
{{ $totalPunches }}
Total Punches
{{ $attendance->count() }}
Days This Page
@forelse($attendance as $day => $punches) @foreach($punches as $index => $punch) @endforeach @empty @endforelse
# Time Flag Device Location / Remarks
{{ date('d M Y, l', strtotime($day)) }}
{{ $index + 1 }} {{ date('h:i A', strtotime($punch->timestamp)) }} {{ $punchFlag($index, $punches->count()) }} {{ $punch->devices ?: '—' }} {{ trim(($punch->location ?: '').' '.($punch->remarks ?: '')) ?: '—' }}
No punch records in this range.
@if($datePages && $datePages->hasPages())
{{ $datePages->links() }}
@endif
@endif
@endsection @section('script') @endsection