Skip to content

chat message is getting on page refresh #6

@Asifkrishaweb

Description

@Asifkrishaweb

Hello sir,

i am not getting the message at a time
chat message is come on page refresh

is Laravel echo unable to listen MessageSent event ?

          Echo.join('chat')
            .listen('MessageSent',(event) => {
                this.messages.push(event.message);
            })

Event

use Dispatchable, InteractsWithSockets, SerializesModels;

public $message;

/**
 * Create a new event instance.
 *
 * @return void
 */
public function __construct(Message $message)
{
    $this->message = $message;
}

/**
 * Get the channels the event should broadcast on.
 *
 * @return \Illuminate\Broadcasting\Channel|array
 */
public function broadcastOn()
{
    return new PresenceChannel('chat');
}

what mistake i am doing

can you please help

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions