Download the PHP package andreshg112/pusher-api-notifications without Composer
On this page you can find all versions of the php package andreshg112/pusher-api-notifications. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download andreshg112/pusher-api-notifications
More information about andreshg112/pusher-api-notifications
Files in andreshg112/pusher-api-notifications
Package pusher-api-notifications
Short Description Send Pusher API Notifications
License MIT
Homepage https://github.com/andreshg112/pusher-api-notifications
Informations about the package pusher-api-notifications
Pusher API Notifications
This package makes it easy to send notifications using Pusher API Messages (like shown below) with Laravel 5.3 or greater.
Contents
- Setting up the Pusher API Notifications service
- Available Message methods
- Changelog
- Testing
- Security
- Contributing
- Credits
- License
Installation
Require the package:
Setting up the Pusher API Notifications service
This package requires pusher/pusher-http-laravel ^4.2, so after installing this, you have to configure it.
If your using Laravel ^5.5, don't worry about adding the service provider to your
config/app.php
file because this package uses Laravel Package Discovery. If don't, you have to add it:
Usage
This is a third-party Laravel Notification Package, so you should know how to use Notifications in Laravel before using this. Docs can be found here: https://laravel.com/docs/master/notifications.
In your notification, add the PusherApiChannel
to the via()
function:
Then, create a method called toApiNotification()
in your notification:
Available Message methods
channels($channelName)
: array or string of channel name(s).event($eventName)
: the name of the event for the Pusher message.data($data)
: array, string or something that can be corverted to JSON. It's the body of the Pusher message.socketId($socketId)
: [optional] socketId of Pusher.debug($debug)
: [optional] boolean that tells Pusher if you're debugging.alreadyEncoded($alreadyEncoded)
: [optional] If the data is already encoded and you don't want Pusher to convert it, set this to true.
These parameters are the same received by Pusher::trigger()
method.
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
- Andrés Herrera García
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of pusher-api-notifications with dependencies
illuminate/notifications Version ^5.3|^5.4|^5.5|^5.6|^5.7|^5.8|^6.0|^7.0
illuminate/support Version ^5.1|^5.2|^5.3|^5.4|^5.5|^5.6|^5.7|^5.8|^6.0|^7.0
pusher/pusher-http-laravel Version ^4.2