$value) { DB::table($table)->where('event_id', self::$event_id)->where('provider_id', self::$provider_id)->update(['active_spread' => 0]); } foreach (self::$collector as $table => $bookmaker) { foreach ($bookmaker as $bookmaker_id => $values) { if (in_array($table, ['odds_points', 'odds_points_ht', 'odds_points_q1'])) { DB::table($table) ->where('event_id', self::$event_id) ->where('bookmaker_id', $bookmaker_id) ->where('handicap', $values['active_spread']) ->update(['active_spread' => 1]); } else { DB::table($table) ->where('event_id', self::$event_id) ->where('bookmaker_id', $bookmaker_id) ->where('total', $values['active_spread']) ->update(['active_spread' => 1]); } } } } }