PHPUnit – Seeding inside your test methods

If you want to run seeders before each test you can use the artisan command in each of your test methods.

Running all seeders with:


Running only one specific seeder:

$this->artisan('db:seed', ['--class' => 'RolesTableSeeder']);


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.