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.
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?
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
Please or to participate in this conversation.