pluck('name'); $url = 'https://xml2.txodds.com/feed/boid_states.php?ident=betaid1&passwd=Dy59vpRC&last='.Nuh::$options['lastcall']; $data = Xml::load($url); foreach ($data as $row) { foreach ($tables as $table) { DB::table($table)->where('offer_id', (int) $row['id'])->update(['last_updated' => $row['last_updated'], 'flags' => $row['flags']]); } } /** * OTHER */ $tables = OddsTable::where('other', 1)->pluck('name'); $url = 'https://xml2.txodds.com/feed/boid_states.php?ident=betaid2&passwd=Dy59vpRC&last='.Nuh::$options['lastcall']; $data = Xml::load($url); foreach ($data as $row) { foreach ($tables as $table) { DB::table($table)->where('offer_id', (int) $row['id'])->update(['last_updated' => $row['last_updated'], 'flags' => $row['flags']]); } } Supervisor::where('id', Nuh::$options['supervisor_id'])->update(['lastcall' => time()]); } }