private function updateResultType($n) { $matches = Match::select('id', 'team_a', 'team_b', 'winner', 'a_odds', 'b_odds', 'time', 'result_category')->orderBy('time', 'desc')->limit($n)->get(); foreach ($matches as $match) { if ($match->result_category == null or $match->result_category == "NONE") { $match->result_category = DataLoader::determineResultType($match); $match->save(); } } }