@extends('layouts.master') @section('title', 'Employee Attendance') @section('content')
Attendance
Employee Attendance
{{ \Carbon\Carbon::parse($today)->format('l, d M Y') }}
@php $currentEmployee = $employees->firstWhere('user_id', auth()->user()->id); $todayAttendance = $currentEmployee?->attendances()->where('date', $today)->first(); @endphp @if (auth()->user()->hasRole('Super-Admin') || auth()->user()->hasRole('admin')) @else
{{-- Left: Check-In Time --}}

Check In Time

{{ $todayAttendance?->check_in?->format('h:i A') ?? '—' }}
@if (!$todayAttendance || !$todayAttendance->check_in)
@csrf
@elseif(!$todayAttendance->check_out)
@csrf
@else @endif
{{-- Right: Check-Out Time --}}

Check Out Time

{{ $todayAttendance?->check_out?->format('h:i A') ?? '—' }}
@endif {{-- Attendance Table --}}
@foreach ($employees as $employee) @foreach ($employee->attendances as $att) date == $today) class="table-success" @endif> @endforeach @endforeach
Employee Date Check-In Check-Out Status Notes
{{ $employee->first_name }} {{ $employee->last_name }} {{ \Carbon\Carbon::parse($att->date)->format('d-m-Y') }} {{ $att->check_in?->format('h:i A') ?? '—' }} {{ $att->check_out?->format('h:i A') ?? '—' }} {{ ucfirst($att->status ?? '—') }} {{ $att->notes ?? '-' }}
@endsection @push('styles') @endpush @push('scripts') @endpush