25 lines
554 B
PHP
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;
|
|
}
|
|
}
|