Skip to content

Commit

Permalink
[8.x] Add documentation for optional 'exclude' parameter of the Prune…
Browse files Browse the repository at this point in the history
…Command (#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 <taylor@laravel.com>
  • Loading branch information
jochensengier and taylorotwell committed Nov 29, 2021
1 parent 074cb85 commit 8349059
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions eloquent.md
Expand Up @@ -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
Expand Down

0 comments on commit 8349059

Please sign in to comment.