@extends('layouts.sidebar') @section('title', 'Attendance') @section('content') @if (in_array('Manage Attendance', $privileges)) @php // Get the authenticated user $user = Auth::user(); // Check if the user has assigned agency IDs $agencyIds = $user->viewable_agency_ids; // If the user has agency IDs, filter the departments by associated agency if (!empty($agencyIds)) { $client = App\Models\Department::whereHas('client', function ($q) use ($agencyIds) { // Filter clients by agencies $q->whereIn('agency_id', $agencyIds); })->get(); } else { // If no agency IDs assigned, fetch all departments $client = App\Models\Department::all(); } @endphp @include('Admin.Attendance.complete.modal')
Employee ID | Client Name | Name Employee | Date | Time In | Time Out | Notes | status | Actions |
---|