wip
This commit is contained in:
1 parent
f1b30223d5
commit
4480680c8d
3 files changed
+85
No files matched your search
@@ -28,7 +28,10 @@ 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;
|
||||
@@ -41,6 +44,7 @@ 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
|
||||
{
|
||||
@@ -610,6 +614,36 @@ 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)
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?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,3 @@
|
||||
<div>
|
||||
{{ $this->content }}
|
||||
</div>
|
||||
Reference in new issue
Block a user