19 lines
401 B
PHP
19 lines
401 B
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use App\Models\ActivityLog;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Queue\Queueable;
|
|
|
|
class CleanupActivityLogsJob implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
|
|
private const RETENTION_DAYS = 90;
|
|
|
|
public function handle(): void
|
|
{
|
|
ActivityLog::where('logged_at', '<', now()->subDays(self::RETENTION_DAYS))->delete();
|
|
}
|
|
}
|