Laravel Pro Tips
🔥 #Laravel Tip: Seeding your database one record at a time can slow the DB to a halt. A better option is to use PHP to make a bunch of records and then seed them in chunks. Here’s how you can go from 10,000 queries to 5!
Matt Kingshott 🏝
🔥 #Laravel Tip: Sometimes you need to seed a database with millions of records e.g. for stress-testing. To avoid crippling the DB with millions of ‘create’ queries, instead consider ‘making’ a large collection of models, then chunk and insert them.
Laravel Tip 💡 Eloquent model factories are not only helpful for building your test suite but also for seeding your local database to get your project set up in seconds.
Boost your productivity by assigning a bash alias like 'fresh' 🚀
My 1st Laravel tip in here.
Speed up your Seeders
No articles were found.