diff --git a/app/Livewire/EncounterHistory.php b/app/Livewire/EncounterHistory.php index 5d22751e..a7da2ea9 100644 --- a/app/Livewire/EncounterHistory.php +++ b/app/Livewire/EncounterHistory.php @@ -51,8 +51,8 @@ class EncounterHistory extends Component implements HasSchemas TextEntry::make('time')->formatStateUsing(function ($state) { return Carbon::createFromTimestamp($state)->format('d. m. Y H:i'); }), - TextEntry::make('home.name')->color(fn ($state) => $state == $this->home ? 'primary' : 'warning'), - TextEntry::make('away.name')->color(fn ($state) => $state == $this->away ? 'warning' : 'primary'), + TextEntry::make('home.name'), + TextEntry::make('away.name'), TextEntry::make('ss'), ]), ]), @@ -72,8 +72,8 @@ class EncounterHistory extends Component implements HasSchemas TextEntry::make('time')->formatStateUsing(function ($state) { return Carbon::createFromTimestamp($state)->format('d. m. Y H:i'); }), - TextEntry::make('home.name')->color(fn ($state) => $state == $this->home ? 'primary' : 'warning'), - TextEntry::make('away.name')->color(fn ($state) => $state == $this->home ? 'primary' : 'warning'), + TextEntry::make('home.name'), + TextEntry::make('away.name'), TextEntry::make('ss'), ]), ]), @@ -93,8 +93,8 @@ class EncounterHistory extends Component implements HasSchemas TextEntry::make('time')->formatStateUsing(function ($state) { return Carbon::createFromTimestamp($state)->format('d. m. Y H:i'); }), - TextEntry::make('home.name')->color(fn ($state) => $state == $this->away ? 'warning' : 'primary'), - TextEntry::make('away.name')->color(fn ($state) => $state == $this->away ? 'warning' : 'primary'), + TextEntry::make('home.name'), + TextEntry::make('away.name'), TextEntry::make('ss'), ]), ]), @@ -102,9 +102,11 @@ class EncounterHistory extends Component implements HasSchemas ]); } - public function mount($betsapi_id) + public function mount($betsapi_id, $home, $away) { $this->betsapi_id = $betsapi_id; + $this->home = $home; + $this->away = $away; } public function getHome() @@ -119,11 +121,6 @@ class EncounterHistory extends Component implements HasSchemas public function getData() { - $res = Http::get('https://api.b365api.com/v1/event/history?token='.config('env.betsapi_token').'&event_id='.$this->betsapi_id)->json(); - - $this->home = $res['results']['h2h']['0']['home']['name']; - $this->away = $res['results']['h2h']['0']['away']['name']; - - return $res; + return Http::get('https://api.b365api.com/v1/event/history?token='.config('env.betsapi_token').'&event_id='.$this->betsapi_id)->json(); } } diff --git a/resources/views/filament/tables/columns/event-column.blade.php b/resources/views/filament/tables/columns/event-column.blade.php index e213f420..f18c5289 100644 --- a/resources/views/filament/tables/columns/event-column.blade.php +++ b/resources/views/filament/tables/columns/event-column.blade.php @@ -14,6 +14,7 @@ @endif