You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes you may want to periodically delete completed workflows that are no longer needed. To accomplish this, you may use the `model:prune` artisan command.
By default, only completed workflows older than 1 month are pruned. You can control this via configuration setting.
13
+
14
+
```php
15
+
'prune_age' => '1 month',
16
+
```
17
+
18
+
You can schedule the `model:prune` artisan command in your application's `routes/console.php` file.
19
+
20
+
```php
21
+
Schedule::command('model:prune', [
22
+
'--model' => StoredWorkflow::class,
23
+
])->daily();
24
+
```
25
+
26
+
You can also control which workflows are pruned by extending the base workflow model and implementing your own `prunable` method.
27
+
28
+
```php
29
+
public function prunable(): Builder
30
+
{
31
+
//
32
+
}
33
+
```
34
+
35
+
You may test the `model:prune` command with the `--pretend` option. When pretending, the `model:prune` command will report how many records would be pruned if the command were to actually run.
0 commit comments