Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

CrastyCrap's avatar

Pusher listen to public channels only

I am trying to listen to Pusher but i can listen only when the channel is public , at first i tried to add channel name like (my-channel) then i found Pusher send the channel name on private (private-channel-name) so i changed to private-channel-name but still no response came on the console

var pusher = new Pusher('my-key', {
    cluster: 'sa1'
});

var channel = pusher.subscribe('private-my-channel');
channel.bind('status', function(data) {
    console.log(data);
});

my laravel event 

public $user;

public function __construct(array $user)
{
    $this->user = $user;
}

public function broadcastOn(): array
{
    return [
        new PrivateChannel('my-channel'),
    ];
}

public function broadcastAs()
{
    return 'status';
}
0 likes
0 replies

Please or to participate in this conversation.