toDateString(); $onVacationToday = Vacation::query() ->where('status', ApprovalStatus::Approved) ->whereDate('start_date', '<=', $today) ->whereDate('end_date', '>=', $today) ->count(); $onSickLeaveToday = SickLeave::query() ->whereDate('start_date', '<=', $today) ->whereDate('end_date', '>=', $today) ->count(); $pendingRequests = Vacation::query() ->where('status', ApprovalStatus::Pending) ->count(); return [ Stat::make('Total Employees', Employee::query()->count()) ->description('All employees in the system') ->descriptionIcon('heroicon-o-users') ->color('primary'), Stat::make('Active', Employee::query()->where('employment_status', EmploymentStatus::Active)->count()) ->description('Currently active employees') ->descriptionIcon('heroicon-o-check-circle') ->color('success'), Stat::make('Inactive', Employee::query()->where('employment_status', EmploymentStatus::Inactive)->count()) ->description('Inactive employees') ->descriptionIcon('heroicon-o-pause-circle') ->color('gray'), Stat::make('On Vacation Today', $onVacationToday) ->description('Approved vacations in progress') ->descriptionIcon('heroicon-o-sun') ->color('warning'), Stat::make('On Sick Leave Today', $onSickLeaveToday) ->description('Employees on sick leave') ->descriptionIcon('heroicon-o-heart') ->color('danger'), Stat::make('Pending Requests', $pendingRequests) ->description('Vacation requests awaiting approval') ->descriptionIcon('heroicon-o-clock') ->color('info'), ]; } }