Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

318
Vistas
Why Laravel Echo not listening

I'm working on a small chat project, but it seems like Laravel echo is not listening, since I can see the log (message) correctly on pusher website dashboard

this is my code :

mounted: function(){
        
        Echo.private('chat').listen('MessageSent', (e) => {
            console.log(e)
            
        });
    },

This is my bootstrap.js file

import Echo from 'laravel-echo';

window.Pusher = require('pusher-js');

window.Echo = new Echo({
    broadcaster: 'pusher',
    key: process.env.MIX_PUSHER_APP_KEY,
    cluster: process.env.MIX_PUSHER_APP_CLUSTER,
    forceTLS: true
});


my channel.php


Broadcast::channel('chat', function ($user) {
    return auth()->check();
});

By the way I see the messages on pusher dashboard, but my vue application is not listening

I'm getting in the console:

No callbacks on private-chat
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Put . before event name

Chang this

mounted: function(){
        
        Echo.private('chat').listen('MessageSent', (e) => {
            console.log(e)
            
        });
    },

to this

mounted: function(){
        
        Echo.private('chat').listen('.MessageSent', (e) => {
            console.log(e)
            
        });
    },
about 4 years ago · Juan Pablo Isaza Denunciar

0

Fixed I had ->toOthers() on my broadcast so I just opened a private navigation

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda