Files
nuhodds_fi4/app/Livewire/EncounterHistroy.php
T
2026-03-09 08:36:08 +01:00

66 lines
2.1 KiB
PHP

<?php
namespace App\Livewire;
use Filament\Actions\Concerns\InteractsWithActions;
use Filament\Actions\Contracts\HasActions;
use Filament\Infolists\Components\RepeatableEntry;
use Filament\Infolists\Components\TextEntry;
use Filament\Schemas\Components\Tabs;
use Filament\Schemas\Components\Tabs\Tab;
use Filament\Schemas\Concerns\InteractsWithSchemas;
use Filament\Schemas\Contracts\HasSchemas;
use Filament\Schemas\Schema;
use Illuminate\Support\Facades\Http;
use Livewire\Component;
class EncounterHistroy extends Component implements HasActions, HasSchemas
{
use InteractsWithActions;
use InteractsWithSchemas;
public $record;
public $history;
public function mount($record)
{
// $this->record = $record;
$this->record = Http::get('https://api.b365api.com/v1/event/history?token='.config('env.betsapi_token').'&event_id='.$record->betsapi_id)->json();
}
public function eventInfolist(Schema $schema): Schema
{
return $schema
->record($this->record)
->components([
RepeatableEntry::make('comments')
->schema([
TextEntry::make('results'),
])
->columns(2),
// Tabs::make('Tabs')
// ->tabs([
// Tab::make($this->record->home->name.' vs '.$this->record->away->name)
// ->schema([
// TextEntry::make('home.name'),
// ]),
// Tab::make($this->record->home->name)
// ->schema([
// TextEntry::make($this->history->result->h2h->name),
// ]),
// Tab::make($this->record->away->name)
// ->schema([
// // ...
// ]),
// ])->vertical(),
]);
}
public function render()
{
return view('livewire.encounter-histroy');
}
}