This repository has been archived by the owner on Feb 7, 2024. It is now read-only.
can't listen to events from blade #1022
Unanswered
felandres3
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First of all I apologize as English is not my main language. I think I have everything configured correctly, when I try to make a console.log of e.message, but it does not bring anything.
broadcasting.php
`<?php
return [
];
`
bootstrap.js
`window._ = require('lodash');
/**
*/
window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
/**
*/
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,
wsHost: window.location.hostname,
wsPort: 6001,
});
This is supposed to receive the broadcast message
Echo.channel('events').listen('RealTimeMessage', (e) => {
console.log(e.message);
});`
Beta Was this translation helpful? Give feedback.
All reactions