PHP code example of tokenly / pusher-client

1. Go to this page and download the library: Download tokenly/pusher-client 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/ */

    

tokenly / pusher-client example snippets


$channel = 'my-event-channel-name';
$data = json_encode(['fromUser' => 'fred', 'messageId' => 101, 'messageText' => 'hello world!']);

$pusher = app(\Tokenly\PusherClient\Client::class);
$pusher->send($channel, $data);