1. Go to this page and download the library: Download obaid/pushmanlib 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/ */
obaid / pushmanlib example snippets
composer
use Pushman\PHPLib\Pushman;
$pushman = new Pushman('private-key-goes-here');
$response = $pushman->push('kittens_are_cute', 'public', ['foo' => 'asdasdasdasd']);
use Pushman\PHPLib\Pushman;
$pushman = new Pushman('private-key-goes-here');
$response = $pushman->push('kittens_are_cute', ['public', 'auth'], ['foo' => 'asdasdasdasd']);
use Pushman\PHPLib\Pushman;
$pushman = new Pushman('private-key-goes-here, ['url' => 'http://pushman.yoursite.com']);
$response = $pushman->push('kittens_are_cute', 'public', ['foo' => 'asdasdasdasd']);
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class UserCreated extends Event implements ShouldBroadcast {
public $user;
public function __construct($user)
{
$this->user = $user;
}
public function broadcastOn()
{
return ['public'];
}
}
use Pushman\PHPLib\Pushman;
$pushman = new Pushman('private-key-goes-here');
$response = $pushman->token('public');
$token = $response['token'];
use Pushman\PHPLib\Pushman;
$pushman = new Pushman('private-key-goes-here');
$response = $pushman->channel('auth');
$max_connections = $response['max_connections'];
$response = $pushman->channels();
foreach($response as $channel) {
echo("Found channel {$channel['name']}.\n");
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.