getProjects(); // Ein projektgebundenes Token sieht nur sein eigenes Projekt. $bound = ApiAuth::projectFilter($context); if ($bound !== null) { $projects = array_values(array_filter( $projects, static fn(array $p): bool => (string)$p['slug'] === $bound )); } Http::ok([ 'count' => count($projects), 'projects' => array_map(static function (array $p): array { return [ 'id' => (int)$p['id'], 'slug' => (string)$p['slug'], 'name' => (string)$p['name'], 'notes' => $p['notes'] ?? null, 'repo_url' => $p['repo_url'] ?? null, 'default_agent' => $p['default_agent'] ?? null, 'open_items' => (int)($p['open_items'] ?? 0), 'critical_items' => (int)($p['critical_items'] ?? 0), ]; }, $projects), ]);