toDateString(); $to = $now->addDays(1)->toDateString(); $url = Grapper::$domain.'feed/result/xml.php?'.Grapper::$auth."&date=$from,$to"; if ($debug) { Notice::note($url, 'y'); } $xml = simplexml_load_file($url, null, LIBXML_NOCDATA); foreach ($xml->match as $_match) { Event::updateOrCreate([ 'txid' => (int) $_match['id'], 'spid' => Grapper::$options['sport_id'], 'prid' => Grapper::$options['provider_id'], 'cnid' => (int) $_match->group['cnid'], // country_id 'grid' => (int) $_match->group['id'], // group_id 'cgid' => (int) $_match->group['cgid'], // competition_group_id 'hoid' => (int) $_match->hteam['id'], 'awid' => (int) $_match->ateam['id'], 'home' => (string) $_match->hteam, 'away' => (string) $_match->ateam, 'liga' => (string) $_match->group['cname'], ], [ 'time' => Carbon::parse($_match->time)->toDateTimeString(), ]); } } } }