o1; $odds['under'] = (float) $value->o2; $odds['total'] = (float) $value->o3; } if ($odds['sport_id'] == 1) { if ((float) $odds['total'] != 2.5) { return; } } else { if (fmod((float) $odds['total'], 1) != 0.5) { return; } } $odds['margin'] = (float) Margin::calculate([$odds['over'], $odds['under']], 1); $odds['difference'] = abs(1 / $odds['over'] - 1 / $odds['under']); ActiveSpread::collect($odds, 'odds_totals'); DB::table('odds_totals')->updateOrInsert([ 'event_id' => Nuh::$id, 'bookmaker_id' => Nuh::$bookmaker_id, 'total' => $odds['total'], ], $odds); } }