where('id', $id) ->first(); } public function countActiveEmployees(): int { return Employee::query() ->active() ->count(); } public function countActiveRegisteredEmployees(): int { return Employee::query() ->active() ->whereHas('customer') ->count(); } public function countActiveEmployeesWithin(CarbonInterface $start, CarbonInterface $end): int { return Employee::query() ->active() ->whereDate('created_at', '>=', $start) ->whereDate('created_at', '<=', $end) ->count(); } public function countActiveRegisteredEmployeesWithin(CarbonInterface $start, CarbonInterface $end): int { return Employee::query() ->active() ->whereHas('customer') ->whereDate('created_at', '>=', $start) ->whereDate('created_at', '<=', $end) ->count(); } }