get(); $count = $players->count(); if ($count == 0) { $this->info('No need to update.'); return; } $this->info('We are going to update your `players` table. Please wait...'); $bar = $this->output->createProgressBar($count); $players->each(function ($player) use ($bar) { $player->tid_skin = $player->preference == 'default' ? $player->tid_steve : $player->tid_alex; $player->save(); $bar->advance(); }); $bar->finish(); $this->info("\nCongratulations! We've updated $count rows."); } }