Files
nuhodds_fi4/app/Console/Commands/Grapper/TxOdds/Countries.php
T
2025-08-14 11:23:27 +02:00

34 lines
962 B
PHP

<?php
namespace App\Console\Commands\Grapper\TxOdds;
use App\Console\Commands\Grapper\Grapper;
use App\Models\Country;
use App\Utilities\Notice;
class Countries
{
public static function grap()
{
Notice::note('disabled as txodds data is a mess, had to fix all manually', 'r', 1);
$response = simplexml_load_file(Grapper::$domain.'feed/countries.php', null, LIBXML_NOCDATA);
foreach ($response->country as $country) {
$res = Country::where('txid', $country->id)->first();
if ($res !== null) {
// $res->txid = $country->id;
// $res->txid = $country->id;
// $res->save();
} else {
$res = new Country;
$res->name = $country->name;
$res->iso3 = $country->cc;
$res->txid = $country->id;
$res->tx_only = 1;
$res->save();
}
}
}
}