Sapnesh Naik
Senior Full Stack Software Developer
Full stack software developer with 6 years of experience building highly scalable web applications using using backend, frontend, and cloud-based technologies.

How to Quickly Seed 100K records in Laravel

May 15, 2020
How to Quickly Seed 100K records in Laravel

Client

CodeZen - https://codezen.io

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

https://codezen.io/how-to-quickly-seed-100k-records-in-laravel/