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
24
24
{--schema-path= : The path to a schema dump file}
25
25
{--pretend : Dump the SQL queries that would be run}
26
26
{--seed : Indicates if the seed task should be re-run}
27
+ {--seeder= : The class name of the root seeder}
27
28
{--step : Force the migrations to be run so they can be rolled back individually} ' ;
28
29
29
30
/**
@@ -89,7 +90,10 @@ public function handle()
89
90
// seed task to re-populate the database, which is convenient when adding
90
91
// a migration and a seed at the same time, as it is only this command.
91
92
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
+ ]);
93
97
}
94
98
});
95
99
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ protected function migrateUsing()
56
56
{
57
57
return [
58
58
'--seed ' => $ this ->shouldSeed (),
59
+ '--seeder ' => $ this ->seeder (),
59
60
];
60
61
}
61
62
You can’t perform that action at this time.
0 commit comments