I need to foreach array from session. My controller code
return [
'buys' => request()->session()->get('userBuys')
];
Vue component
export default {
data() {
return {
buys: {}
}
},
methods: {
async getBuys() {
this.$axios.post('/products/mybuys')
.then(res => {
this.buys = res.data.buys
this.$root.hideLoading()
})
}
},
mounted() {
this.$root.showLoading()
this.getBuys()
}
}
So i'm getting array
How i need to foreach this array correctly? I tried a lot of...