Skip to content

Commit b94408d

Browse files
committed
Merge branch 'master' of https://github.com/dbhynds/framework into dbhynds-master
2 parents 47c2c6f + 9d687c9 commit b94408d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Illuminate/Database/Console/PruneCommand.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class PruneCommand extends Command
2525
{--model=* : Class names of the models to be pruned}
2626
{--except=* : Class names of the models to be excluded from pruning}
2727
{--chunk=1000 : The number of models to retrieve per chunk of models to be deleted}
28-
{--pretend : Display the number of prunable records found instead of deleting them}';
28+
{--pretend : Display the number of prunable records found instead of deleting them}
29+
{--path=* : Absolute path(s) to directories where models are located}';
2930

3031
/**
3132
* The console command description.
@@ -125,7 +126,7 @@ protected function models()
125126
throw new InvalidArgumentException('The --models and --except options cannot be combined.');
126127
}
127128

128-
return collect((new Finder)->in($this->getDefaultPath())->files()->name('*.php'))
129+
return collect((new Finder)->in($this->getPath())->files()->name('*.php'))
129130
->map(function ($model) {
130131
$namespace = $this->laravel->getNamespace();
131132

@@ -146,12 +147,16 @@ protected function models()
146147
}
147148

148149
/**
149-
* Get the default path where models are located.
150+
* Get the path where models are located.
150151
*
151152
* @return string|string[]
152153
*/
153-
protected function getDefaultPath()
154+
protected function getPath()
154155
{
156+
if (! empty($path = $this->option('path'))) {
157+
return $path;
158+
}
159+
155160
return app_path('Models');
156161
}
157162

0 commit comments

Comments
 (0)