A good example is here https://forum.vuejs.org/t/for-loop-and-axios/19885
Generally you will have an array of objects to loop.
Hello I am trying to convert object request to api controller but everytime I fail. I did try search on google and tried those methods but fails. I have these so far:
Vue
let data = new FormData();
data.append('images', this.images);
let config = {
headers: {
'Content-Type': 'multipart/form-data',
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,
'Authorization': `Bearer ${document.querySelector('meta[name="api_token"]').content}`
}
};
axios.post('/api/test', data, config)
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
Controller
function api_test(Request $request)
{
dd($request->images);
}
In the "this.images" format is this in the console: Name Highlight Default Description Path
However I get this: ""[object Object],[object Object],[object Object]""
How can I read those many objects? The objects volume depends on how many images the person wants to upload.
Please or to participate in this conversation.