Category : vuex

Hi everyone I would like to send the notification and then broadcast it. I follow all the steps and successfully notifications sending and receiving but I don’t know what happened it stopped broadcasting my events only notifications are still saving in the database. Can anyone please tell me what is the issue? thanks in advance. ..

Read more

(Sorry for my english) I’m still newbie in vue js. I’m really confused why this addRoutes always returns an error like this. "vue": "^2.6.12", "vue-router": "^3.5.1", "vuex": "^3.6.2" "laravel-mix": "^6.0.6", Error picture app.js import "normalize.css/normalize.css"; import "vuetify/dist/vuetify.min.css"; import "roboto-fontface/css/roboto/roboto-fontface.css"; import Vue from "vue"; import Vuetify from "vuetify"; import vuetify from "./plugins/vuetify"; import i18n from "./locale"; ..

Read more

i use laravel with vuex ,i succesfully configured all setting in my app but i get this error getting errors: Error in beforeCreate hook: "TypeError: Cannot set property $store of #<Vue> which has only a getter also app.js:164694 TypeError: Cannot set property $store of #<Vue> which has only a getter at Vue.vuexInit (app.js:181831) at invokeWithErrorHandling ..

Read more

Basic dilemma/query Are repeat database calls considered an acceptable price to pay in honouring separation of concerns and maintainable code? Is front-end processing of tasks – that e.g. build arrays of complex objects – a counter-productive way of minimising repeat database calls? Background I followed a Udemy course that builds the bare bones of a ..

Read more

I am new to vuex I want to access user object that is inside in state by the getters getUser() method, I tried to call this console.log(this.$store.getters.getUser); in mounted method but no results. I tried to console log inside mutations and it return the user object. I also followed documentations and googled the solutions but ..

Read more

I’m developing a project with Laravel (back) and Vuejs (with Vuex). I also use Sanctum:auth to authenticate users, laravel-websockets and Laravel-Echo for broadcast. Before, I had received an authentication problem on my console with the error: "POST ‘broadcast / auth’ 404 not found". I was able to solve it after watching a tutorial that combined ..

Read more

<pagination :data="users" @pagination-change-page="getUsers"> store.js state:{ users:[] }, getters:{ users(state) { return state.users; }, }, mutations:{ updateUsers(state, payload) { state.users = payload; }, }, actions:{ getUsers(context) { axios.get(‘/api/user’) .then((response) => { context.commit(‘updateUsers’, response.data); }) }, } userlist.vue export default { mounted() { this.getResults(); this.$store.dispatch(‘getUsers’); }, methods: { getResults(page = 1) { this.$store.dispatch(‘getUsers’, { page: page }); ..

Read more

Im trying to run couple of axios calls in a nuxtjs front-end , laravel backend project with nuxtServerInit so they get called at server side.while adding this peice of code async nuxtServerInit({commit}) { const usercompany = await this.$axios.get(‘dashboard/getusercompanyfresh’) console.log(usercompany) if(usercompany.data != undefined && usercompany.data !== ”){ await commit(‘SET_USERCOMPANY’, usercompany.data); } if(usercompany.data != undefined && usercompany.data ..

Read more

Hello i’m facing the problem with Laravel and Vuejs It’s seems that Vue not recognized, I already executed npm install This is my dependencies : "devDependencies": { "@fortawesome/fontawesome-free": "^5.15.1", "axios": "^0.19", "bootstrap": "^4.5.3", "cross-env": "^7.0", "jquery": "^3.2", "laravel-mix": "^5.0.7", "lodash": "^4.17.20", "popper.js": "^1.12", "resolve-url-loader": "^2.3.1", "sass": "^1.27.0", "sass-loader": "^8.0.0", "vue": "^2.6.12", "vue-loader": "^15.9.4", "vue-template-compiler": "^2.6.12" ..

Read more

I’m building an SPA with Laravel, Vue js and Vuex. In AppSidebar.vue, I’m using an if statement that basically says if the employer profile exists, show the link for the "View Profile" page, if it doesn’t exist show the link for the "Create Profile" page. AppSidebar.vue: <ul class="nav flex-column sub-menu"> <template v-if="!this.employerProfiles"> <li class="nav-item"><router-link class="nav-link" ..

Read more

i make a many to many relationship table with Laravel and i use frontend as vuejs. i want to get all my related job category ids into specific person. my models looks like this. In my Person modal relationship looks like this. public function interests() { return $this->belongsToMany(SubCategory::class, ‘basic_detail_sub_category’, ‘basic_detail_id’, ‘sub_category_id’)->withTimestamps(); } and my Job ..

Read more

I have the following Laravel api route Route::get(‘c/maintenances/{contractor_user_id}’, ‘[email protected]’); The contractor_user_id is dynamic and got from the database. I want to use it to get the resource collection returned by that particular contractor using the Vuex store async getContractorMaintenances ({ commit, contractor_user_id }) { let response = await axios.get(`/api/c/maintenances/${contractor_user_id}`) commit(‘PUSH_CONTRACTOR_MAINTENANCES’, response.data.data) } but the contractor_user_id ..

Read more

Here is the click event of Manage Category. Here is the remove method that’s method working in Vue js code. <button type="button" class="btn btn-danger btn-sm" @click="remove(category.id)">Delete</button> Vue JS code is here Here is a method of remove. When I deleted data it’s show notification. <script> export default { name: "manage", mounted() { this.$store.dispatch("getCategories"); }, computed:{ ..

Read more

I am using vuex to store state, and I’m seeing an odd problem: it seems that it is changing the id on one of my objects. In my action, I download information about a note saveNote({commit}, noteInfo) { var formData = new FormData(); Object.keys(noteInfo.note).forEach(key => formData.append(key, noteInfo.note[key])); return axios.post("/notes/saveText/" + noteInfo.note.id, formData).then(res => commit(‘SAVE_NOTE’, res.data)).catch(err ..

Read more

This is my vuex store file: export const posts = { namespaced: true, state: { currentPost: ”, posts: [], }, mutations: { SET_POSTS(state, posts) { state.posts = posts }, SET_POST(state, post) { state.currentPost = post }, actions: { fetchPosts({commit}) { PostAPI.getPosts() .then(function(response) { commit(‘SET_POSTS’, response.data) }) }, fetchPost({commit}, postId) { PostAPI.getPost(postId) .then(function(response) { commit(‘SET_POST’, response.data); ..

Read more