laravel-notification-channels/webpush
Laravel notification channel for sending Web Push notifications. Supports VAPID keys, major browsers, rich payload options (title, actions, data, TTL), and easy subscription management on models with automatic cleanup of expired endpoints.
This is a major release containing several breaking changes:
nullPushSubscription-model the property content_encoding is now casted to the Minishlink\WebPush\ContentEncoding-enum, therefore minishlink/web-push is bumped to at least v10.0.1MessageValidationFailed class is now marked as finalWebPushMessageInterface interface now requires getOptions() to be defined on classes implementing this interfaceFull Changelog: https://github.com/laravel-notification-channels/webpush/compare/10.5.0...11.0.0
chore: add support for laravel 13 (https://github.com/laravel-notification-channels/webpush/commit/4e7a9b5accce086c989bc061587ad2f51809887b)
Full Changelog: https://github.com/laravel-notification-channels/webpush/compare/10.4.0...10.5.0
Full Changelog: https://github.com/laravel-notification-channels/webpush/compare/10.3.0...10.4.0
Full Changelog: https://github.com/laravel-notification-channels/webpush/compare/10.2.0...10.3.0
Update web-push library to v9. https://github.com/laravel-notification-channels/webpush/pull/204
$message to ReportHandlerWebPushMessage::options()HasPushSubscriptions can now be used on any model.id and create methods from WebPushMessage.badge, dir, image, lang, renotify, requireInteraction, tag, vibrate, data methods on WebPushMessage.Install the latest version via composer:
composer require laravel-notification-channels/webpush
Generate the VAPID keys with (required for browser authentication) with:
php artisan webpush:vapid
If you still want support Google Cloud Messaging set the GCM_KEY and GCM_SENDER_ID in your .env file. Previously these keys where stored in config/services.php.
For a complete implementation with a Service Worker check this demo.
How can I help you explore Laravel packages today?