From 83490597b2a580d08cb0de2fd2dfbd6ba4ebd4a6 Mon Sep 17 00:00:00 2001 From: Jochen Sengier Date: Mon, 29 Nov 2021 15:35:49 +0100 Subject: [PATCH] [8.x] Add documentation for optional 'exclude' parameter of the PruneCommand (#7470) * [8.x] Add documentation for optional 'exclude' parameter of the PruneCommand https://github.com/laravel/framework/pull/39749 * Update eloquent.md * Update eloquent.md Co-authored-by: Taylor Otwell --- eloquent.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eloquent.md b/eloquent.md index 129c419ba8..af95a9c523 100644 --- a/eloquent.md +++ b/eloquent.md @@ -944,6 +944,12 @@ Behind the scenes, the `model:prune` command will automatically detect "Prunable '--model' => [Address::class, Flight::class], ])->daily(); +If you wish to exclude certain models from being pruned while pruning all other detected models, you may use the `--except` option: + + $schedule->command('model:prune', [ + '--except' => [Address::class, Flight::class], + ])->daily() + 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: php artisan model:prune --pretend