" if (! str_starts_with($path, 'principals/')) { return null; } $id = substr($path, strlen('principals/')); $user = User::find($id); return $user ? $this->format($user) : null; } public function getPrincipalsByPrefix($prefixPath) { // Sabre passes "principals" as the prefix for /principals/* return User::all()->map(fn ($u) => $this->format($u))->all(); } /* ---------- the five extra interface methods ---------- */ public function updatePrincipal($path, $mutations) { // not writable for now return false; } public function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof', $limit = 100) { // not implemented yet return []; } public function getGroupMemberSet($principal) { return []; } public function getGroupMembership($principal) { return []; } public function setGroupMemberSet($principal, array $members) { return false; // read-only } /* ---------- helper ---------- */ private function format(User $u) { return [ 'id' => $u->id, 'uri' => $u->uri, // "principals/" '{DAV:}displayname' => $u->displayname ?? $u->name, '{http://sabredav.org/ns}email-address' => $u->email, ]; } }