Web Push
This package allows you to connect into a micro service for handling web push notifications., (*1)
Installation
composer require jsefton/web-push
Usage
Push::init("API_KEY")
->setMode('dev')
->send([
'site' => 'default',
'payload' => [
'title' => $data['title'],
'body' => $data['message']
]
]);
Methods
init
First method that should be called passing in a valid API key., (*2)
setMode
Allows to switch between different API modes and domains that are preset., (*3)
setDomain
Allows to override the API domain that requests are sent too., (*4)
send
Array of data that is passed onto the API. Requires payload
as an array of supportted web push data. site
optional to bind for a specific site., (*5)