Repository navigation
UserPasskey
Pair\Models\UserPasskey is the ActiveRecord model for WebAuthn credentials (user_passkeys table). New applications should apply migrations/20260918_user_passkeys.sql before enabling passkeys.
It stores the credential identifier, public key, signature counter, and lifecycle metadata (usage/revocation timestamps).
iduserId-
credentialId(base64url) -
publicKey(PEM) signCountlabel-
transports(JSON string) lastUsedAtrevokedAtcreatedAtupdatedAt
Returns one active credential by ID (revoked_at IS NULL).
Returns all active credentials for a user, ordered by newest first.
Returns decoded transport list ([] when missing/invalid).
Returns true when revokedAt is set.
Updates lastUsedAt and updatedAt, and increases stored counter when the new value is higher.
Sets revokedAt and updatedAt.
Normalizes and stores transports as JSON.
// list active user passkeys
$items = \Pair\Models\UserPasskey::getActiveByUserId($user->id);
// revoke one credential
$passkey = new \Pair\Models\UserPasskey($id);
if ($passkey->isLoaded() && !$passkey->isRevoked()) {
$passkey->revoke();
}See also: PasskeyAuth, PasskeyController, ActiveRecord, Collection.
Maintained by Viames Marino — VM Ingegneria · Professional enquiries
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4