Skip to content

Commit 8349059

Browse files
[8.x] Add documentation for optional 'exclude' parameter of the PruneCommand (#7470)
* [8.x] Add documentation for optional 'exclude' parameter of the PruneCommand laravel/framework#39749 * Update eloquent.md * Update eloquent.md Co-authored-by: Taylor Otwell <[email protected]>
1 parent 074cb85 commit 8349059

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

eloquent.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,12 @@ Behind the scenes, the `model:prune` command will automatically detect "Prunable
944944
'--model' => [Address::class, Flight::class],
945945
])->daily();
946946

947+
If you wish to exclude certain models from being pruned while pruning all other detected models, you may use the `--except` option:
948+
949+
$schedule->command('model:prune', [
950+
'--except' => [Address::class, Flight::class],
951+
])->daily()
952+
947953
You may test your `prunable` query by executing the `model:prune` command with the `--pretend` option. When pretending, the `model:prune` command will simply report how many records would be pruned if the command were to actually run:
948954

949955
php artisan model:prune --pretend

0 commit comments

Comments
 (0)