Sapnesh Naik
Software Developer, Technical Writer
Blog Post

How to Quickly Seed 100K records in Laravel

May 15, 2020


CodeZen -

Article Excerpt

I recently worked on a project where I had to insert a lot of dummy data into a database for testing. Laravel provides a feature called seeding just for this purpose. Seeding can take much time if you are trying to insert many records. In my case, I was trying to seed 100k users into my User model database, and it was taking a long time. However, by doing some optimization, I was able to bring down the execution time from ~75 seconds to around ~30 seconds!. So, let me show you how to quickly seed 100k records in Laravel.

Article Link