Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Webpush Bundle Laravel Package

bentools/webpush-bundle

Symfony bundle to send Web Push notifications using the Web Push protocol. Manage user-to-subscription associations (multi-device and shared devices) with your own persistence (Doctrine or custom). Includes VAPID key generation and backend APIs for subscriptions.

View on GitHub
Deep Wiki
Context7

Configuration

Configure the bundle:

# app/config/config.yml (SF3)
# config/packages/bentools_webpush.yaml (SF4) 
bentools_webpush:
    settings:
        # subject: <URI>
        public_key: 'your_public_key'
        private_key: 'your_private_key'

The subject is optional, with a fallback being router.request_context.host. You may need to define it explicitly if you are working in a CLI context.

Note that Apple requires the subject to be an URL or a mailto URL.

Update your router:

# app/config/routing.yml (SF3)
# config/routing.yaml (SF4)
bentools_webpush:
    resource: '[@WebPushBundle](https://github.com/WebPushBundle)/Resources/config/routing.yaml'
    prefix: /webpush

You will have a new route called bentools_webpush which will be the Ajax endpoint for handling subscriptions (POST requests) / unsubscriptions (DELETE requests).

Your VAPID public key is now exposed through Twig's bentools_webpush.server_key global variable.

To handle subscriptions/unsubscriptions on the front-end side, have a look at webpush-client.

Previous: The UserSubscription Manager

Next: Usage

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky