Skip to content

Commit c24e457

Browse files
committed
Adds comment pruning section
1 parent 0d401e7 commit c24e457

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

+32
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,38 @@ return [
157157
];
158158
```
159159

160+
## Pruning deleted comments
161+
162+
Comment records are set to be pruned after 30 days of being soft-deleted by default. You may change this value in the config file:
163+
164+
```php
165+
return [
166+
'prune_after_days' => 30,
167+
];
168+
```
169+
170+
After configuring the model, you should schedule the `model:prune` Artisan command in your application's `Kernel` class. Don't forget to explicitly mention the `FilamentComment` class. You are free to choose the appropriate interval at which this command should be run:
171+
172+
```php
173+
namespace App\Console;
174+
175+
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
176+
use Parallax\FilamentComments\Models\FilamentComment;
177+
178+
class Kernel extends ConsoleKernel
179+
{
180+
protected function schedule(Schedule $schedule)
181+
{
182+
$schedule->command('model:prune', [
183+
'--model' => [FilamentComment::class],
184+
])->daily();
185+
186+
// This will not work, as models in a package are not used by default
187+
// $schedule->command('model:prune')->daily();
188+
}
189+
}
190+
```
191+
160192
## Changelog
161193

162194
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

0 commit comments

Comments
 (0)