Laravel + VueJS: Cant call routers within Store.js

As mention in Vue Router documentation, we can simply use this.$router.push(‘router-name’) to get to the other component.

For some reason, i have some issues to use it in my store.js.

One of the solution i found here, where i need to exports all declaration inside app.js to other instance, then import it in my store.js.

app.js

const app = new Vue({
    el: '#app',
    router,
    store
});

export {app}

store.js

// import the app instance
import {app} from './app'
.
.
.
//calling example
app.$router.push('route-name');

Reference: