Download the PHP package alexlisenkov/laravel-web-push without Composer
On this page you can find all versions of the php package alexlisenkov/laravel-web-push. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alexlisenkov/laravel-web-push
More information about alexlisenkov/laravel-web-push
Files in alexlisenkov/laravel-web-push
Package laravel-web-push
Short Description Send push notifications from your backend via the Web Push Protocol
License MIT
Informations about the package laravel-web-push
Send Push Notification in Laravel
The alexlisenkov/laravel-web-push
package is a package to send push notifications.
Send out push messages as a standalone package. Use this if you dont work with laravel notification channels.
If you are new to the Web Push Protocol please read about the fundamentals.
Installation
Configuration
To send out Web Push notifications you need to generate yourself an identity. The simplest thing to do is to visit https://web-push-codelab.glitch.me
Open up config/laravel-web-push.php
Copy the public key and private key into your configuration. Please note that this public key is the same as you will use in the applicationServerKey in the JavaScript pushManager api.
Sending a Web Push
Quick guide
A message can be created by creating a new AlexLisenkov\LaravelWebPush\PushMessage
class.
Please see this MDN doc or the Living Standards to see all available options.
Creating message objects
A message can be created by creating a new class that extends the AlexLisenkov\LaravelWebPush\PushMessage
class.
Please see this MDN doc or the Living Standards to see all available options.
Creating a subscription
The AlexLisenkov\LaravelWebPush\PushSubscription
is used to create a new subscription.
It is also possible for you to implement AlexLisenlov\LaravelWebPush\Contracts\PushSubscriptionContract
into any class.
For example on a model.
Sending a notification
Now that we have a subscriber and a message, we can send it out.
Service worker
Show a notification to the subscriber by adding an event listener in your service worker.
Testing
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Contributing
Contributions are welcome.
- PSR-2 coding standards
- Keep the project tested
- Keep your pull requests small and limited
Credits
- Alex Lisenkov
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-web-push with dependencies
simplito/elliptic-php Version ^1.0
spomky-labs/base64url Version ^2.0
ext-gmp Version *
ext-openssl Version *
ext-json Version *
guzzlehttp/guzzle Version ^7.2
web-token/jwt-framework Version ^2.2
ext-mbstring Version *