Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dengdeng's avatar

php artisan migrate:refresh --seed

Hey , i know what php artisan migrate:refresh command mean. But i don't understand php artisan migrate:refresh --seed command. The website said it can rollback and re-run all migrations. And i tested it, it seems these two commands work out the same result. So what's the meaning of putting a --seed optional argument after command?

0 likes
2 replies
dengdeng's avatar

Well, i know why. If just specify --seed, it just executes DatabaseSeeder, if you defined call method to call other seeders, it works. But if not, you need to add another argument --seeder to specify seeder classname to execute.

EventFellows's avatar
Level 16
php artisan migrate:refresh 

rolls back all migrations and then runs all migrations

php artisan db:seed

runs /database/seeds/DatabaseSeeder.php and all Seeders defined within it

php artisan migrate:refresh --seed 

is basically a sequence of both commands above and does the same as if you run them one after the other

So if you find --seed not making any different there are some likely cases:

  • DatabaseSeeder does not define any Seeders and/ or
  • the Seeders defined are not doing any seeding
4 likes

Please or to participate in this conversation.