Laravel WebPush Notification Channel
Web push notification channel for Laravel using the browser Push API and VAPID.
Repository Health
Technical Analysis
Laravel WebPush Notification Channel is a driver for Laravel’s notification system that delivers browser push notifications via the W3C Push API. It integrates with Laravel notifications so you can push messages to users’ desktop and mobile browsers the same way you send mail or SMS.
Built on the minishlink/web-push library, it handles VAPID key authentication, stores and manages push subscriptions on your user models through a trait and migration, and provides a fluent message builder for titles, bodies, icons, actions, and custom data payloads. It works across Chrome, Firefox, Edge, and Safari.
What You Get
- A
WebPushChannelintegrating browser push into Laravel’s notification system - A fluent
WebPushMessagebuilder for title, body, icon, badge, image, actions, TTL, and data - A
HasPushSubscriptionstrait plus migration to save, update, and delete subscriptions on models - VAPID key generation via an artisan command and secure browser authentication
- Sent/failed events and an expired-subscription report handler for cleanup
Common Use Cases
- Sending browser push notifications to logged-in web users
- Notifying users across Chrome, Firefox, Edge, and Safari
- Managing push subscriptions stored against user models
- Automatically pruning expired or invalid push subscriptions
Under The Hood
Architecture - src/WebPushServiceProvider.php registers the driver, publishes a config/webpush.php, a migration for the push_subscriptions table, and the VapidKeysGenerateCommand. src/WebPushChannel.php resolves a notifiable’s stored PushSubscription records (via the HasPushSubscriptions trait) and builds a WebPushMessage, then delegates actual delivery to the minishlink/web-push library over VAPID. A ReportHandler inspects delivery reports and dispatches NotificationSent/NotificationFailed events, deleting subscriptions the browser reports as gone.
Tech Stack - PHP 8.2+, minishlink/web-push ^10 for the Push protocol and encryption, and illuminate/notifications + illuminate/support (Laravel 12/13). PSR-4 autoloaded under NotificationChannels\WebPush\.
Code Quality - Long-lived and well-maintained (200+ commits, 27 releases since 2016) with Larastan static analysis, Laravel Pint, Rector, and a PHPUnit/Testbench suite plus Scrutinizer coverage. Interfaces (WebPushMessageInterface, ReportHandlerInterface) keep the design extensible.
API Design - It follows Laravel notification conventions closely: add HasPushSubscriptions to a model, return a fluent WebPushMessage from toWebPush(), and generate VAPID keys with one artisan command. Subscription persistence is handled for you, keeping setup minimal.