60 lines
1.2 KiB
PHP
60 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Tables\Columns;
|
|
|
|
use Filament\Tables\Columns\Column;
|
|
|
|
class ColumnDnb extends Column
|
|
{
|
|
protected string $view = 'filament.tables.columns.column-dnb';
|
|
|
|
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['dnb1'] = $record->odds_dnb->max('dnb1');
|
|
$this->min['dnb1'] = $record->odds_dnb->min('dnb1');
|
|
|
|
$this->max['dnb2'] = $record->odds_dnb->max('dnb2');
|
|
$this->min['dnb2'] = $record->odds_dnb->min('dnb2');
|
|
|
|
$this->max['margin'] = $record->odds_dnb->max('margin');
|
|
$this->min['margin'] = $record->odds_dnb->min('margin');
|
|
|
|
$this->has_data = count($record->odds_dnb) ? true : false;
|
|
}
|
|
|
|
public function getMax()
|
|
{
|
|
return $this->max;
|
|
}
|
|
|
|
public function getMin()
|
|
{
|
|
return $this->min;
|
|
}
|
|
|
|
public function hasData()
|
|
{
|
|
return $this->has_data;
|
|
}
|
|
}
|