Files
nuhodds_fi4/app/Console/Commands/Grapper/TxOdds/Fixtures/TxLiga.php
T
2025-08-30 08:15:10 +02:00

25 lines
554 B
PHP

<?php
namespace App\Console\Commands\Grapper\TxOdds\Fixtures;
use App\Models\Liga;
class TxLiga
{
public static function find($country_id, $group)
{
$cname = array_column($group, 'cname');
$spid = array_column($group, 'spid');
$cgid = array_column($group, 'cgid');
$liga = Liga::firstOrCreate([
'name' => (string) $cname[0],
'sport_id' => (int) $spid[0],
'country_id' => $country_id,
'txodds_id' => (int) $cgid[0],
]);
return $liga->id;
}
}