0

I am using Channel broadcasting with laravel and vue.js in order to have all user online and offline. I have installed the package correctly and configured pusher params according to laravel documentation.

In my vue component I wrote following to see who is online on the related channel:

created() {
    this.getFriends();

    window.Echo.join('Room')
         .here(users => {

         });
}

But I get following error:
Error in created hook: "TypeError: window.Echo is undefined" "

Boostrap.js

import Echo from 'laravel-echo';

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

window.Echo = new Echo({
    broadcaster: 'pusher',
    //key: process.env.MIX_PUSHER_APP_KEY,
    key:'****************',
    //cluster: process.env.MIX_PUSHER_APP_CLUSTER,
    cluster: 'eu',
    encrypted: true
});
sodskat
  • 137
  • 2
  • 12

0 Answers0