-1👍
The catch() block only gets called if the Laravel backend throws an error. So if you are returning a normal status code of 2xx then axios always calls the .then() part. In that case, you have to resolve the error message yourself.
Try something like this in your backend route (it will return an error):
return response()->toJson([
'message' => 'error message',
], 500);
And see if this responds with an actual error in you vuejs application.
- [Vuejs]-How to set class to child element inside v-for loop
- [Vuejs]-How can I use lang class laravel in vue.js 2?
Source:stackexchange.com