Files
nuhodds_fi4/app/Filament/Tables/Columns/ColumnDc.php
T
2026-01-04 06:29:11 +01:00

63 lines
1.3 KiB
PHP

<?php
namespace App\Filament\Tables\Columns;
use Filament\Tables\Columns\Column;
class ColumnDc extends Column
{
protected string $view = 'filament.tables.columns.column-dc';
protected ?array $max;
protected ?array $min;
protected ?array $bookmakers;
protected ?bool $has_data;
public function bookmakers(?array $bookmakers): static
{
$this->bookmakers = $bookmakers;
return $this;
}
public function getBookmaker(): ?array
{
return $this->bookmakers;
}
public function loadData($record)
{
$this->max['dc1x'] = $record->odds_dc->max('dc1x');
$this->min['dc1x'] = $record->odds_dc->min('dc1x');
$this->max['dc12'] = $record->odds_dc->max('dc12');
$this->min['dc12'] = $record->odds_dc->min('dc12');
$this->max['dcx2'] = $record->odds_dc->max('dcx2');
$this->min['dcx2'] = $record->odds_dc->min('dcx2');
$this->max['margin'] = $record->odds_dc->max('margin');
$this->min['margin'] = $record->odds_dc->min('margin');
$this->has_data = count($record->odds_dc) ? true : false;
}
public function getMax()
{
return $this->max;
}
public function getMin()
{
return $this->min;
}
public function hasData()
{
return $this->has_data;
}
}