Replace foreach with array_keys in class admin dashboards