30 lines
676 B
PHP
30 lines
676 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands\Grapper\TxOdds\Fixtures;
|
|
|
|
use App\Console\Commands\NuhBash;
|
|
use App\Models\Liga;
|
|
|
|
class TxLigas
|
|
{
|
|
public static function find($group)
|
|
{
|
|
$debug = NuhBash::$options['debug'] ?? 0;
|
|
|
|
$cname = array_column($group, 'cname');
|
|
$spid = array_column($group, 'spid');
|
|
$country_id = TxCountries::get($group);
|
|
$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;
|
|
|
|
}
|
|
}
|