Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

saidu's avatar
Level 1

EventBus for communicating Vue js and Laravel Inertia

Im trying to trigger an event from one component to the other but nothing gets triggered code below... im using laravel 8 with inertia and Vue Js

cancel(){
                EventBus.$emit('cancelEditing', reply)
            }

listen(){
               EventBus.$on('cancelEditing', (reply) => {
                    this.editing = false
                    if(reply !== this.data.reply){
                        this.data.reply = this.beforeEditReplyBody
                        this.beforeEditReplyBody = ''
                    }
                })
            }

app.js

 window.EventBus = new Vue();

any suggestions please

0 likes
1 reply

Please or to participate in this conversation.