Skip to content

Commit 1c496d0

Browse files
committed
use base path
1 parent b94408d commit 1c496d0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Illuminate/Database/Console/PruneCommand.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ class PruneCommand extends Command
2424
protected $signature = 'model:prune
2525
{--model=* : Class names of the models to be pruned}
2626
{--except=* : Class names of the models to be excluded from pruning}
27+
{--path=* : Absolute path(s) to directories where models are located}
2728
{--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}
29-
{--path=* : Absolute path(s) to directories where models are located}';
29+
{--pretend : Display the number of prunable records found instead of deleting them}';
3030

3131
/**
3232
* The console command description.
@@ -149,12 +149,14 @@ protected function models()
149149
/**
150150
* Get the path where models are located.
151151
*
152-
* @return string|string[]
152+
* @return string[]|string
153153
*/
154154
protected function getPath()
155155
{
156156
if (! empty($path = $this->option('path'))) {
157-
return $path;
157+
return collect($path)->map(function ($path) {
158+
return base_path($path);
159+
})->all();
158160
}
159161

160162
return app_path('Models');

0 commit comments

Comments
 (0)