{{-- Navbar Check-in Button & Modal --}} @php $admin = auth('admin')->user(); $staff = $admin ? \App\Models\Admin\Staff::where('admin_id', $admin->id)->first() : null; $todayRecord = null; $isCurrentlyIn = false; if ($staff) { $todayRecord = \Modules\Attendance\Models\Attendance::where('staff_id', $staff->id) ->whereDate('attendance_date', today()) ->first(); if ($todayRecord) { $lastLog = \Modules\Attendance\Models\AttendanceLog::where('attendance_id', $todayRecord->id) ->whereIn('action', ['check_in', 'check_out']) ->orderBy('action_time', 'desc') ->first(); $isCurrentlyIn = $lastLog && $lastLog->action === 'check_in'; } } // Get leave types $leaveTypes = \Modules\Attendance\Models\LeaveType::where('status', true)->orderBy('name')->get(); @endphp {{-- Clock Icon Button --}} {{-- Modal --}}