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
9
9
{
10
10
return $ this ->laravel ->databasePath ('actions ' );
11
11
}
12
+
13
+ protected function getMigrationPaths (): array
14
+ {
15
+ if ($ paths = $ this ->optionPath ()) {
16
+ return $ paths ;
17
+ }
18
+
19
+ return [$ this ->getMigrationPath ()];
20
+ }
12
21
}
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ protected function optionStep(?int $default = null): ?int
19
19
20
20
protected function optionPath (): ?array
21
21
{
22
+ if (! $ this ->hasOption ('path ' )) {
23
+ return null ;
24
+ }
25
+
22
26
if ($ path = $ this ->option ('path ' )) {
23
27
return collect ($ path )->map (function ($ path ) {
24
28
if ($ this ->usingRealPath ()) {
Original file line number Diff line number Diff line change @@ -62,18 +62,10 @@ public function handle()
62
62
protected function prepareDatabase (): void
63
63
{
64
64
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
+ ]));
68
69
}
69
70
}
70
-
71
- protected function getMigrationPaths (): array
72
- {
73
- if ($ paths = $ this ->optionPath ()) {
74
- return $ paths ;
75
- }
76
-
77
- return [$ this ->getMigrationPath ()];
78
- }
79
71
}
Original file line number Diff line number Diff line change 4
4
5
5
use DragonCode \LaravelActions \Concerns \Database ;
6
6
use DragonCode \LaravelActions \Concerns \Infoable ;
7
+ use DragonCode \LaravelActions \Concerns \Optionable ;
7
8
use DragonCode \LaravelActions \Constants \Names ;
8
9
use Illuminate \Database \Console \Migrations \StatusCommand as BaseCommand ;
9
10
10
11
class Status extends BaseCommand
11
12
{
12
13
use Database;
13
14
use Infoable;
15
+ use Optionable;
14
16
15
17
/**
16
18
* The console command name.
You can’t perform that action at this time.
0 commit comments