1👍
Finally, I found a way to submit files.
just append files in FormData using the loop goes through all files array
let formData = new FormData();
for (let i = 0; i < this.files.length; i++) {
formData.append('files_upload[]', this.files[i]);
}
And in PHP using
$files_upload = $request->file('files_upload');
foreach($files_upload as $file){
Excel::import(new ModelImport, $file);
}
to import to model using Laravel Excel
- [Vuejs]-How to work with vue.js and window.getSelection()?
- [Vuejs]-Vue Router resolve view change only when all components in view have fetched their required data
Source:stackexchange.com