[Vuejs]-Laravel websocket wont trigger event from vue front end

0๐Ÿ‘

โœ…

I dont know why .join wont work but I used window.Echo.channel i doubt this is the right thing to do.

    created(){
            this.getProducts()
            this.getSuppliers()

            // Echo.join('Products')
            //     .listen('ProductsEvent',(event)=>{
            //         // this.products.push(event.products)
            //         this.getProducts()
            //     })
            //     .here(()=>{
            //         console.log('here')
            //     })

            window.Echo.channel('Products').listen('ProductsEvent',(e)=>{
                    this.getProducts()
                    toastr.success('Product Updated')
            })
        }

Leave a comment