Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

317
Views
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 answers
Answer question

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 Report

0

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

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!