Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chat message is getting on page refresh #6

Open
Asifkrishaweb opened this issue Jun 18, 2021 · 0 comments
Open

chat message is getting on page refresh #6

Asifkrishaweb opened this issue Jun 18, 2021 · 0 comments

Comments

@Asifkrishaweb
Copy link

Asifkrishaweb commented Jun 18, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant