1<?php
2
3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
4// See the LICENCE file in the repository root for full licence text.
5
6declare(strict_types=1);
7
8namespace App\Console\Commands;
9
10use App\Models\DailyChallengeUserStats;
11use Carbon\CarbonImmutable;
12use Illuminate\Console\Command;
13
14class DailyChallengeUserStatsCalculate extends Command
15{
16 protected $signature = 'daily-challenge:user-stats-calculate';
17
18 protected $description = "Calculate user stats from the result of previous day's daily challenge";
19
20 public function handle(): void
21 {
22 DailyChallengeUserStats::calculate(CarbonImmutable::today()->subDays(1));
23 }
24}