wip
This commit is contained in:
1 parent
4480680c8d
commit
d08613c54c
9 files changed
+119
-139
No files matched your search
@@ -28,10 +28,7 @@ use Filament\Forms\Components\Hidden;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Components\FusedGroup;
|
||||
use Filament\Schemas\Components\Tabs;
|
||||
use Filament\Schemas\Components\Tabs\Tab;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Support\Enums\VerticalAlignment;
|
||||
use Filament\Support\Enums\Width;
|
||||
@@ -44,7 +41,6 @@ use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class EventsTable
|
||||
{
|
||||
@@ -614,36 +610,6 @@ class EventsTable
|
||||
EventUserStar::insert(['event_id' => $record->id, 'user_id' => auth()->user()->id]);
|
||||
}
|
||||
}),
|
||||
Action::make('view_details')
|
||||
->iconButton()
|
||||
->color('gray')
|
||||
->tooltip('Encounter history')
|
||||
->label('Encounter history')
|
||||
->icon('phosphor-info')
|
||||
->modalWidth(Width::ThreeExtraLarge)
|
||||
->action(function ($record) {
|
||||
$data = Http::get('https://api.b365api.com/v1/event/history?token=36152-aeTRNnZxSPUwGe&event_id='.$record->id)->json();
|
||||
dd($data);
|
||||
})
|
||||
->infolist(fn ($record) => [
|
||||
Tabs::make('Tabs')
|
||||
->tabs([
|
||||
Tab::make($record->home->name.' vs '.$record->away->name)
|
||||
->schema([
|
||||
TextEntry::make('home.name'),
|
||||
]),
|
||||
Tab::make($record->home->name)
|
||||
->schema([
|
||||
// ...
|
||||
]),
|
||||
Tab::make($record->away->name)
|
||||
->schema([
|
||||
// ...
|
||||
]),
|
||||
]),
|
||||
])
|
||||
->modalSubmitAction(false)
|
||||
->modalCancelActionLabel('Close'),
|
||||
Action::make('event_note')
|
||||
->modalIcon('phosphor-note-pencil-duotone')
|
||||
->modalWidth(Width::Large)
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use Filament\Actions\Concerns\InteractsWithActions;
|
||||
use Filament\Actions\Contracts\HasActions;
|
||||
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\Contracts\View\View;
|
||||
use Livewire\Component;
|
||||
|
||||
class EncounterHistory extends Component implements HasActions, HasSchemas
|
||||
{
|
||||
use InteractsWithActions;
|
||||
use InteractsWithSchemas;
|
||||
|
||||
public function content(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->record($this->event)
|
||||
->components([
|
||||
Tabs::make('Tabs')
|
||||
->tabs([
|
||||
Tab::make('Direct')
|
||||
->schema([
|
||||
TextEntry::make('home.name'),
|
||||
]),
|
||||
Tab::make('Home')
|
||||
->schema([
|
||||
// ...
|
||||
]),
|
||||
Tab::make('Away')
|
||||
->schema([
|
||||
// ...
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public function render(): View
|
||||
{
|
||||
return view('livewire.encounter-history');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class PartnerProgramm extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.partner-programm');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user