*/ public static function classes(int $profId): Collection { return Classe::hydrate(Cache::rememberForever( "prof:{$profId}:classes", fn () => Classe::where('user_id', $profId)->withCount('eleves')->orderBy('nom')->get()->map->getAttributes()->all() )); } public static function vider(int $profId): void { Cache::forget("prof:{$profId}:classes"); } }