Should use batch inserts (https://docs.laravel-excel.com/3.1/imports/batch-inserts.html).
LARAVEL-EXCEL for import -> rules check is increasing AUTO_INCREMENT counter for failed imports
Hi,
So I am using laravel-excel package for importing contacts through excel file. The tutorial I am using is https://www.itsolutionstuff.com/post/laravel-11-import-export-excel-and-csv-file-tutorialexample.html.
It is working fine for correct uploads. However, if any entry is hunted down by rules breach (and the script throws an error to correct it), I noticed that my database table's auto_increment value gets changed to a higher value, even when no record is entered in the table. For example, if AI counter is at 10, and I try to import a 100 contacts file where contact 99 has some wrong value, after the file upload failed attempt, the AI counter will show 109, and not 10.
Can someone help about what I am doing wrong? My code is pretty much what is pasted in the tut website I mentioned above.
Thanks.
Please or to participate in this conversation.