PHP code example of cavaon-wayne / pusher-php-client

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

    

cavaon-wayne / pusher-php-client example snippets


Cavaon\Pusher\ServiceProvider::class,

'CavaonPusher' => Cavaon\Pusher\Facade::class,
'CavaonEvent'  => Cavaon\Pusher\Events\Event::class,

        'pusher' => [
            'driver' => 'pusher',
            'key' => env('PUSHER_KEY'), //ANY DUMMPY STRING WILL DO
            'secret' => env('PUSHER_SECRET'), //YOUR SECRET HERE
            'app_id' => env('PUSHER_APP_ID'), //YOUR APP ID HERE
            'options' => [
                "host"=>env('PUSHER_HOST'), // YOUR PUSHER SERVER HERE, eg 'http://192.168.1.1'
                "port"=>env('PUSHER_HOST_PORT'), //YOUR PUSHER SERVER PORT HERE, eg '37037'
            ],
        ],

$wsHostURL=CavaonPusher::getHostURL();
$token=CavaonPusher::getToken();

$data=["id"=>1,"name"=>"Sydney day tour","price"=>100.5];
event(new CavaonEvent('your-channnel-name','your-event-name',$data));

php artisan queue:listen