first commit
Some checks failed
Build / run (push) Has been cancelled

This commit is contained in:
maher
2025-10-29 11:42:25 +01:00
commit 703f50a09d
4595 changed files with 385164 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
<?php
namespace Common\Logging;
use Common\Logging\Mail\OutgoingEmailLogItem;
use Common\Logging\Schedule\ScheduleLogItem;
use Illuminate\Console\Command;
class CleanLogTables extends Command
{
protected $signature = 'app-logs:clean';
protected $description = 'Delete old log entries from the database.';
public function handle()
{
ScheduleLogItem::where('ran_at', '<', now()->subDays(30))->delete();
OutgoingEmailLogItem::where(
'created_at',
'<',
now()->subDays(7),
)->delete();
$this->info('Old log entries have been deleted.');
return self::SUCCESS;
}
}