26 lines
475 B
PHP
26 lines
475 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands\Grapper\TxOdds\Fixtures;
|
|
|
|
use App\Models\Element;
|
|
|
|
class TxElement
|
|
{
|
|
public static function find($element, $sport_id)
|
|
{
|
|
|
|
// dd($element);
|
|
|
|
$txodds_id = array_column($element, 'id');
|
|
|
|
$element = Element::firstOrCreate([
|
|
'name' => (string) $element['@text'],
|
|
'sport_id' => $sport_id,
|
|
'txodds_id' => (int) $txodds_id[0],
|
|
]);
|
|
|
|
return $element->id;
|
|
|
|
}
|
|
}
|