PHP code example of tomato-technologies / tomato-pusher-php

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

    

tomato-technologies / tomato-pusher-php example snippets


Tomato\Pusher\ServiceProvider::class,

'TomatoPusher' => Tomato\Pusher\Facade::class,
'TomatoEvent'  => Tomato\Pusher\Events\Event::class,

    "tomato_pusher" => [
        'app_id' => env('TOMATO_PUSHER_APP_ID'),
        'app_secret' => env('TOMATO_PUSHER_APP_SECRET'),
    ],

$appId=TomatoPusher::getAppId();
//or $appId=config("services.tomato_pusher.app_id");
$token=TomatoPusher::getToken();

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

php artisan queue:listen
shell
composer