argument('username'); if ($username) { $user = User::where('name', $username)->first(); if (! $user) { $this->error("No user found with username [{$username}]."); return; } $user->calculateAchievements(); $this->info("Recalculated achievements for {$username}."); return; } $users = User::all(); $this->withProgressBar($users, fn (User $user) => $user->calculateAchievements()); $this->newLine(); $this->info("Recalculated achievements for {$users->count()} users."); } }