command->info('Set all expenses type to internal...'); $datas = Expense::select('id', 'type') ->get(); if (count($datas) < 1) { $this->command->info('No matching data found'); return; } $this->command->getOutput()->progressStart($datas->count()); DB::transaction(function () use (&$datas) { foreach ($datas as $expense) { Expense::where('id', $expense->id)->update(['type' => 'internal']); $this->command->getOutput()->progressAdvance(); } }); $this->command->getOutput()->progressFinish(); } }