Files
nuhodds_fi4/app/Console/Commands/Grapper/TxOdds/Fixtures/TxElement.php
T
2025-08-27 14:37:53 +02:00

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;
}
}