Seeding Your Database


You want to seed your database.

You've already written your database seeds and now you want to tell Laravel to seed the database.


Use the php artisan db:seed command.

$ php artisan db:seed

If you're using a different class than default for the root seeder, you can use the --class option.

$ php artisan db:seed --class=MyDatabaseSeeder


Seeding is usually done for testing.

It's a great way to generate a standard set of records on your development machine.

comments powered by Disqus