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
Copy file name to clipboardExpand all lines: README.md
+32
Original file line number
Diff line number
Diff line change
@@ -157,6 +157,38 @@ return [
157
157
];
158
158
```
159
159
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
+
160
192
## Changelog
161
193
162
194
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
0 commit comments