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
and in echo.js
My problem is in the .listen section, where the event is not executed
this is channels.php
channels.php
My Answer:
In Laravel Echo, a PresenceChannel is a type of channel that allows you to subscribe to presence channel events, such as when a user joins or leaves a channel. Presence channels are useful for building real-time collaborative applications where you need to track the presence of multiple users in a channel.
On the other hand, listen events are used to listen for custom events that are broadcasted from the server to the client. These events can be triggered by any action on the server, such as creating a new post or updating a user profile.
In summary, PresenceChannel is specifically designed for tracking the presence of users in a channel, while listen events are more general and can be used to listen for any custom events broadcasted from the server. Both can be useful in different scenarios depending on the requirements of your application.
Rate this post
5 of 5 based on 4704 votesComments