[Vuejs]-How to submit multiple csv files in laravel using axios (vuejs) and import by laravel excel

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

Leave a comment