0👍
It’s good to pass response as JSON Format
YourXYZController.php
....
$data = new stdClass;
$data->status = "success";
$data->message = "your message";
return response(json_encode($data));
in Vuejs
axios.post('YourXYZController URL', params)
.then(response => {
console.log(response)
})
.catch(error => {
console.log(response)
})
})
And also it’s best practice to check request and response in network tab of browser.
- [Vuejs]-Vue – Filter 2D Array but modify original unfiltered array v-models
- [Vuejs]-Vue js axios cannot read property 'data' of undefined
Source:stackexchange.com