am using Vue Js and Laravel in my application. My code has products and images. I am able to upload images using axios but when I add vform to validate all my images , no image is passed to the controller. When I interchange axios.post('/senddata', formData, config) to this.form.post('/senddata', formData, config) the other data is passed but images are null. Here is my code;
saveImageData(){
var self=this;
const config = {
headers: { 'content-type': 'multipart/form-data' }
}
document.getElementById('upload-file').value=[];
let formData = new FormData();
formData.append('title', this.form.title);
formData.append('description', this.form.description);
formData.append('location', this.form.location);
formData.append('price', this.form.price);
for(let i=0;i<this.form.images.length;i++){
formData.append('images[]', this.form.images[i]);
}
axios.post('/senddata', formData, config)
.then(function (response) {
})
.catch(function (error) {
});