PHP code example of mrad / notifications-bundle
1. Go to this page and download the library: Download mrad/notifications-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mrad / notifications-bundle example snippets
// From your controller or service
$data = array(
'my-message' => "My custom message",
);
$pusher = $this->get('mrad.pusher.notificaitons');
$channel = 'messages';
$pusher->trigger($data, $channel);
// or you can keep the channel pram empty and will be broadcasted on "notifications" channel by default
$pusher->trigger($data);