@extends('layouts.app') @section('title', 'Attendance') @section('page-icon', 'calendar-check') @section('content') {{-- Google Fonts: Oswald (headings/labels) + Inter (body) --}} @php // $selectedDate should be passed from the controller as 'Y-m-d' (defaults to today). // Falls back to request('date') or today's date if the controller hasn't been updated yet. $selectedDate = $selectedDate ?? request('date', \Carbon\Carbon::now()->format('Y-m-d')); $isToday = $selectedDate === \Carbon\Carbon::now()->format('Y-m-d'); @endphp
{{-- Top bar --}}
Attendance

Check‑In / Check‑Out

Track member attendance for any day

{{-- Date filter --}}
@if (!$isToday) Today @endif
{{-- Success/Error Alerts --}} @if(session('success')) @endif @if(session('error')) @endif {{-- Table --}}
@forelse($users as $key => $user) @php $attendance = $user->attendances->first(); @endphp @empty @endforelse
S.No Member Phone Date Check In Check Out Status Action
{{ $key + 1 }} {{ $user->name }} {{ $user->phone ?? 'N/A' }} {{ \Carbon\Carbon::parse($selectedDate)->format('d M Y') }} @if($attendance && $attendance->check_in) {{ $attendance->check_in }} @else — @endif @if($attendance && $attendance->check_out) {{ $attendance->check_out }} @else — @endif @if($attendance) @if($attendance->check_out) Completed @else In Progress @endif @else Absent @endif
@if(!$isToday) {{-- Past dates are read-only: no editing history --}} — @elseif(!$attendance)
@csrf
@elseif(!$attendance->check_out)
@csrf
@else Done @endif
No members found

No members are registered yet.

@endsection