You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Good time, for the implementation of the chat room, I have done all the Pusher configurations correctly, and sending messages and displaying online users works correctly, but the event in the .listen method does not work, and it does not even log. Thank you for your help. I have been dealing with this problem for a long time. I hit this is my event
`class MessageSended implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets;
public $message;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct(Message $message)
{
$this->message = $message;
}
public function broadcastWith()
{
$this->message->load('user');
return [
'message' => array_merge($this->message->toArray(), [
'selfOwned' => false
])
];
}
/**
* Get the channels the event should broadcast on.
*
* @return \Illuminate\Broadcasting\Channel|array
*/
public function broadcastOn()
{
return new PresenceChannel('chat');
}