Sep 7, 2024
0
Level 1
laravel reverb with auth sanctum issue
i use laravel reverb and when try to connect to public channel every thing is good but when try to connect to private channel broadcast data not returned when make request just receive only this repose in laravel reverb debuger :
{ "event": "pusher:subscribe", "data": { "channel": "chat.2", "auth": "ed5zsi5ebpdmawcqbwva:9e87ca525bdfc96735423e9295272af8c456e4914814a2c8bfdb98feae6f8006" } }
no data retruned and i donot know what is the problem ;
public function __construct(public PrivateChatMessage $privateChatMessage)
{
}
/**
* Get the channels the event should broadcast on.
*
* @return array<int, \Illuminate\Broadcasting\Channel>
*/
public function broadcastOn(): array
{
return [
new PrivateChannel("chat." . $this->privateChatMessage->private_chat_id),
];
}
public function broadcastWith(): array
{
return [
'id'=>'1',
'message'=>'test'
];
}
public function broadcastAs(): string
{
return 'user.chat';
}
and when send message fire event MessageSent
Please or to participate in this conversation.