Skip to content

PushSubscription

Viames Marino edited this page Feb 23, 2026 · 1 revision

Pair framework: PushSubscription

Pair\Models\PushSubscription is the ActiveRecord model for push_subscriptions.

It stores endpoint and key material used by Web Push delivery.

Key fields

  • userId (nullable for guests)
  • endpoint
  • p256dh
  • auth
  • userAgent
  • revokedAt
  • lastSeenAt
  • createdAt
  • updatedAt

Typical usage

Usually accessed through SubscriptionRepository:

$subs = (new \Pair\Push\SubscriptionRepository())->listByUser($userId);

Or with ActiveRecord query helpers when needed.

Notes

  • datetime and integer fields are auto-cast in _init().
  • Repository layer is preferred for business operations.

See also: SubscriptionRepository, Notification, PushDispatcher.

Clone this wiki locally