is_super_admin || $user->hasRole('admin'); } public function isSatisfiedBy(User $user): bool { $strong = Session::get(self::SESSION_KEY); return is_array($strong) && (int) ($strong['user_id'] ?? 0) === (int) $user->getKey(); } /** * @param string $method passkey oder totp */ public function mark(User $user, string $method): void { Session::put(self::SESSION_KEY, [ 'user_id' => $user->getKey(), 'method' => $method, 'at' => now()->getTimestamp(), ]); } public function hasPasskeys(User $user): bool { return $user->passkeys()->exists(); } }