Laravel WebPush Notification Channel

Web push notification channel for Laravel using the browser Push API and VAPID.

Library
Composer
v12.1.0
910stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
73/100Good
Development Activity76
Maintenance52
Community76
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture82
Code Quality85
Innovation64
Learning Curve80

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 WebPushChannel integrating browser push into Laravel’s notification system
  • A fluent WebPushMessage builder for title, body, icon, badge, image, actions, TTL, and data
  • A HasPushSubscriptions trait 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.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search