File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Database/Console/Migrations Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ class MigrateCommand extends BaseCommand
2424 {--schema-path= : The path to a schema dump file}
2525 {--pretend : Dump the SQL queries that would be run}
2626 {--seed : Indicates if the seed task should be re-run}
27+ {--seeder= : The class name of the root seeder}
2728 {--step : Force the migrations to be run so they can be rolled back individually} ' ;
2829
2930 /**
@@ -89,7 +90,10 @@ public function handle()
8990 // seed task to re-populate the database, which is convenient when adding
9091 // a migration and a seed at the same time, as it is only this command.
9192 if ($ this ->option ('seed ' ) && ! $ this ->option ('pretend ' )) {
92- $ this ->call ('db:seed ' , ['--force ' => true ]);
93+ $ this ->call ('db:seed ' , [
94+ '--class ' => $ this ->option ('seeder ' ) ?: 'Database \\Seeders \\DatabaseSeeder ' ,
95+ '--force ' => true ,
96+ ]);
9397 }
9498 });
9599
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ protected function migrateUsing()
5656 {
5757 return [
5858 '--seed ' => $ this ->shouldSeed (),
59+ '--seeder ' => $ this ->seeder (),
5960 ];
6061 }
6162
You can’t perform that action at this time.
0 commit comments