File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/Illuminate/Database/Console Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class PruneCommand extends Command
24
24
{--except=* : Class names of the models to be excluded from pruning}
25
25
{--chunk=1000 : The number of models to retrieve per chunk of models to be deleted}
26
26
{--pretend : Display the number of prunable records found instead of deleting them}
27
- {--path=Models : The default path where models are located} ' ;
27
+ {--path=* : Absolute path(s) to directories where models are located} ' ;
28
28
29
29
/**
30
30
* The console command description.
@@ -97,7 +97,7 @@ protected function models()
97
97
throw new InvalidArgumentException ('The --models and --except options cannot be combined. ' );
98
98
}
99
99
100
- return collect ((new Finder )->in ($ this ->getDefaultPath ())->files ()->name ('*.php ' ))
100
+ return collect ((new Finder )->in ($ this ->getPath ())->files ()->name ('*.php ' ))
101
101
->map (function ($ model ) {
102
102
$ namespace = $ this ->laravel ->getNamespace ();
103
103
@@ -120,9 +120,14 @@ protected function models()
120
120
*
121
121
* @return string
122
122
*/
123
- protected function getDefaultPath ()
123
+ protected function getPath ()
124
124
{
125
- return app_path ($ this ->option ('path ' ));
125
+
126
+ if (! empty ($ path = $ this ->option ('path ' ))) {
127
+ return $ path ;
128
+ }
129
+
130
+ return app_path ('Models ' );
126
131
}
127
132
128
133
/**
You can’t perform that action at this time.
0 commit comments