在laravel 5.3中使用axios上传图像文件

I am new to axios so i need help. I am uploading an image file using axios in laravel 5.3 but axios is not passing the image file to the server. here is my axios code.

formSubmit: function(){

        axios.post('/postdata',this.$data,)
            .then(response => alert('Success'))
            .catch(error => this.errors.record(error.response.data));

    },

the entire form data is submitted except the file itself.

Well I think you should use FormData() object when dealing with ajax file upload.

let formData = new FormData();
this.form.append(ele.target.name, files[0])

axios.post('/postdata', formData)
        .then(response => alert('Success'))
        .catch(error => this.errors.record(error.response.data));