Repository navigation
Notification
Viames Marino edited this page Feb 22, 2026
·
1 revision
Pair\Push\Notification is the payload value object for web push messages.
new Notification(
string $title,
string $body,
?string $url = null,
?string $icon = null,
?string $tag = null,
array $data = []
)Builds service-worker-compatible payload:
- always includes
title,body - adds
iconandtagwhen set - merges custom
data - injects
urlintodata.urlwhen provided
Basic notification:
$notification = new \Pair\Push\Notification(
'New message',
'You have a new message.'
);With deep-link and metadata:
$notification = new \Pair\Push\Notification(
'Order shipped',
'Order #123 has been shipped.',
'/orders/123',
'/img/push/order.png',
'order-123',
['orderId' => 123, 'type' => 'shipping-update']
);Payload sent to push sender:
$payload = $notification->toPayload();$dispatcher = new \Pair\Push\PushDispatcher();
$results = $dispatcher->sendToUser($userId, $notification);See also: PushDispatcher, DeliveryResult, WebPushSender.
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