Implement academy analytics, billing, and web stories updates

This commit is contained in:
2026-05-26 07:27:29 +02:00
parent 456c3d6bb0
commit 0b33a1b074
177 changed files with 27360 additions and 2685 deletions

View File

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace App\Console\Commands;
use App\Models\AcademyEvent;
use Illuminate\Console\Command;
final class AcademyAnalyticsPruneEventsCommand extends Command
{
protected $signature = 'academy:analytics-prune-events {--days=180}';
protected $description = 'Delete old raw Academy analytics events while keeping daily rollups';
public function handle(): int
{
$days = max(1, (int) $this->option('days'));
$deleted = AcademyEvent::query()
->where('occurred_at', '<', now()->subDays($days)->startOfDay())
->delete();
$this->info(sprintf('Pruned %d Academy analytics event(s).', $deleted));
return self::SUCCESS;
}
}