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

60 lines
1.2 KiB
PHP

<?php
namespace App\Filament\Tables\Columns;
use Filament\Tables\Columns\Column;
class ColumnTq extends Column
{
protected string $view = 'filament.tables.columns.column-tq';
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['htq'] = $record->odds_tq->max('htq');
$this->min['htq'] = $record->odds_tq->min('htq');
$this->max['atq'] = $record->odds_tq->max('atq');
$this->min['atq'] = $record->odds_tq->min('atq');
$this->max['margin'] = $record->odds_tq->max('margin');
$this->min['margin'] = $record->odds_tq->min('margin');
$this->has_data = count($record->odds_tq) ? true : false;
}
public function getMax()
{
return $this->max;
}
public function getMin()
{
return $this->min;
}
public function hasData()
{
return $this->has_data;
}
}