From 8c4da2d85ccf517ca072ec3aefcda637b2545cf6 Mon Sep 17 00:00:00 2001 From: Shalvah Date: Fri, 24 Sep 2021 19:49:32 +0100 Subject: [PATCH 1/3] Add docs on model:prune --pretend --- eloquent.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eloquent.md b/eloquent.md index 57ce53ee728..4470e415b83 100644 --- a/eloquent.md +++ b/eloquent.md @@ -942,6 +942,12 @@ Behind the scenes, the `model:prune` command will automatically detect "Prunable '--model' => [Address::class, Flight::class], ])->daily(); +You may test your `prunable` query by running the `model:prune` command with the `--pretend` option. + + php artisan model:prune --pretend + +In pretend mode, the command will run the query and report how many records will be pruned, but will not delete any actual records. + > {note} Soft deleting models will be permanently deleted (`forceDelete`) if they match the prunable query. From 1fa291ced26cfc1a49866d5af12dfbca8eaeb8d8 Mon Sep 17 00:00:00 2001 From: Shalvah Date: Fri, 24 Sep 2021 19:51:33 +0100 Subject: [PATCH 2/3] Fix typo --- eloquent.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eloquent.md b/eloquent.md index 4470e415b83..973ba7452a1 100644 --- a/eloquent.md +++ b/eloquent.md @@ -942,7 +942,7 @@ Behind the scenes, the `model:prune` command will automatically detect "Prunable '--model' => [Address::class, Flight::class], ])->daily(); -You may test your `prunable` query by running the `model:prune` command with the `--pretend` option. +You may test your `prunable` query by running the `model:prune` command with the `--pretend` option: php artisan model:prune --pretend From ee839aed324b4081c6391f15a4dbeba060f7e41d Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 28 Sep 2021 08:11:52 -0500 Subject: [PATCH 3/3] Update eloquent.md --- eloquent.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/eloquent.md b/eloquent.md index 973ba7452a1..3fc926ea744 100644 --- a/eloquent.md +++ b/eloquent.md @@ -942,12 +942,10 @@ Behind the scenes, the `model:prune` command will automatically detect "Prunable '--model' => [Address::class, Flight::class], ])->daily(); -You may test your `prunable` query by running the `model:prune` command with the `--pretend` option: +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 -In pretend mode, the command will run the query and report how many records will be pruned, but will not delete any actual records. - > {note} Soft deleting models will be permanently deleted (`forceDelete`) if they match the prunable query.