File tree Expand file tree Collapse file tree 4 files changed +19
-12
lines changed Expand file tree Collapse file tree 4 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -9,4 +9,13 @@ protected function getMigrationPath(): string
99 {
1010 return $ this ->laravel ->databasePath ('actions ' );
1111 }
12+
13+ protected function getMigrationPaths (): array
14+ {
15+ if ($ paths = $ this ->optionPath ()) {
16+ return $ paths ;
17+ }
18+
19+ return [$ this ->getMigrationPath ()];
20+ }
1221}
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ protected function optionStep(?int $default = null): ?int
1919
2020 protected function optionPath (): ?array
2121 {
22+ if (! $ this ->hasOption ('path ' )) {
23+ return null ;
24+ }
25+
2226 if ($ path = $ this ->option ('path ' )) {
2327 return collect ($ path )->map (function ($ path ) {
2428 if ($ this ->usingRealPath ()) {
Original file line number Diff line number Diff line change @@ -62,18 +62,10 @@ public function handle()
6262 protected function prepareDatabase (): void
6363 {
6464 if (! $ this ->migrator ->repositoryExists ()) {
65- $ this ->call (Names::INSTALL , array_filter ([
66- '--database ' => $ this ->optionDatabase (),
67- ]));
65+ $ this ->call (Names::INSTALL ,
66+ array_filter ([
67+ '--database ' => $ this ->optionDatabase (),
68+ ]));
6869 }
6970 }
70-
71- protected function getMigrationPaths (): array
72- {
73- if ($ paths = $ this ->optionPath ()) {
74- return $ paths ;
75- }
76-
77- return [$ this ->getMigrationPath ()];
78- }
7971}
Original file line number Diff line number Diff line change 44
55use DragonCode \LaravelActions \Concerns \Database ;
66use DragonCode \LaravelActions \Concerns \Infoable ;
7+ use DragonCode \LaravelActions \Concerns \Optionable ;
78use DragonCode \LaravelActions \Constants \Names ;
89use Illuminate \Database \Console \Migrations \StatusCommand as BaseCommand ;
910
1011class Status extends BaseCommand
1112{
1213 use Database;
1314 use Infoable;
15+ use Optionable;
1416
1517 /**
1618 * The console command name.
You can’t perform that action at this time.
0 commit comments