If you want to automate adding data into your Laravel application, seeding is the way to go! Whether it’s for testing purposes or adding in loads of production details, Laravel’s seeders and factories help to rapidly fill up your database tables.
In this video I’ll show you a few different ways to seed data into your database. We’ll start out simple with just single models and the create method, and move up to custom factories and seeder classes.
- 0:00 Getting Started
- 0:31 Seeding Single Models
- 1:38 Using Factories
- 6:49 Seeder Classes
- 9:48 Seeding Model Relationships
- 12:50 Wrapping Up
Follow me on Twitter!
Join my newsletter, where I send out new information about twice each month in the PHP, JavaScript, and Docker realms:
1 view
17
2
1 week ago 02:01:49 2
Trance Harbour Sessions EP 201 Jan 19th 2025
2 weeks ago 00:14:08 2
U.S. Nightmare Became a REALITY: Russia Took Iran Under Its Military and Economic Protection
2 weeks ago 01:21:42 2
The Pope, the Environmental Crisis, and Frontline Leaders | The Letter: Laudato Si Film