$sport_id) { $post_fields = [ 'url' => BaseUrl::get().'/v1/matches?sportId='.$client_sport_id, 'header' => json_encode($header), ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); if (config('env.app_env') == 'local') { curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields); curl_setopt($ch, CURLOPT_URL, 'https://proxydb1.nuhodds.com/logifuture.php'); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Proxy-Auth: AIkcoRnipSgMK88WMQhOQQN3LKDrNDCIebNfPnEayJdmDeTigx', ]); } else { curl_setopt($ch, CURLOPT_HTTPHEADER, $header); } $file = curl_exec($ch); $matches = json_decode($file, 1); if (! isset($matches['error'])) { foreach ($matches as $match) { if (strpos($match['sportCategory'], 'Simulated Reality') === false) { $event = MapEvent::filter($sport_id, $match); FindFixture::search($event, $_groups[$sport_id], $_elements[$sport_id], true); if ($event['id']) { $event_id_collector[] = $event['id']; EventBookmaker::updateOrCreate([ 'event_id' => $event['id'], 'bookmaker_id' => Nuh::$options['bookmaker_id'], ], ['in_feed' => 1, 'bmoid' => $event['event_id']]); $_spreads = []; switch ($sport_id) { case 1: Soccer::get($event, $match); break; case 2: Icehockey::get($event, $_spreads, $match); break; case 3: Basketball::get($event, $_spreads, $match); break; case 5: Tennis::get($event, $_spreads, $match); break; default: Notice::note('SPORT NOT IMPLEMENTED', 'r', 1); break; } } } } } } if ($event_id_collector) { EventBookmaker::whereNotIn('event_id', $event_id_collector)->where('bookmaker_id', Nuh::$options['bookmaker_id'])->update(['in_feed' => 0]); } } }