63 lines
1.3 KiB
PHP
63 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Tables\Columns;
|
|
|
|
use Filament\Tables\Columns\Column;
|
|
|
|
class Column3way extends Column
|
|
{
|
|
protected string $view = 'filament.tables.columns.column_3way';
|
|
|
|
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['h3w'] = $record->odds_3way->max('h3w');
|
|
$this->min['h3w'] = $record->odds_3way->min('h3w');
|
|
|
|
$this->max['d3w'] = $record->odds_3way->max('d3w');
|
|
$this->min['d3w'] = $record->odds_3way->min('d3w');
|
|
|
|
$this->max['a3w'] = $record->odds_3way->max('a3w');
|
|
$this->min['a3w'] = $record->odds_3way->min('a3w');
|
|
|
|
$this->max['margin'] = $record->odds_3way->max('margin');
|
|
$this->min['margin'] = $record->odds_3way->min('margin');
|
|
|
|
$this->has_data = count($record->odds_3way) ? true : false;
|
|
}
|
|
|
|
public function getMax()
|
|
{
|
|
return $this->max;
|
|
}
|
|
|
|
public function getMin()
|
|
{
|
|
return $this->min;
|
|
}
|
|
|
|
public function hasData()
|
|
{
|
|
return $this->has_data;
|
|
}
|
|
}
|