Currently I'm using SparkForm for posting data to the server. However now
I want to send images aswel. I don't want to lose the SparkForm functionalities.
However because I want to send images I have to make a FormData and add an
extra header.
So my question is, is it possible to use FormData in combination with SparkForm?
Right now I've got this:
store() {
let form = new FormData();
for(let key in this.form.images) {
form.append('attachment[' + key + ']', this.form.images[key]);
}
Spark.post('/adds', this.form).then((response) => {
alert('success!');
}).catch((error) => {
this.catchMessage(error);
});
}
But when I dd($request->all()); on my server the images array is empty.
How do I get this to working while keeping the functionalities of the SparkForm?