Club System

This commit is contained in:
2026-06-02 20:54:40 +02:00
parent 0b18d289ef
commit 6f6d6b9b84
6 changed files with 215 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Console\Commands;
use App\Models\Entry;
use Illuminate\Console\Attributes\Description;
use Illuminate\Console\Attributes\Signature;
use Illuminate\Console\Command;
#[Signature('entries:purge-rejected {--days=7}')]
#[Description('Soft Delete rejected entries older than X days')]
class DeleteRejectedEntries extends Command
{
/**
* Execute the console command.
*/
public function handle()
{
$days = (int) $this->option('days');
$count = Entry::where('state', 'rejected')
->where('rejected_at', '<', now()->subDays($days))
->delete();
$this->info("Deleted {$count} entries");
}
}