bookmaker comaring wip
This commit is contained in:
1 parent
d351e6fb60
commit
d07277ae06
8 files changed
+171
-90
No files matched your search
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\ComparingBookmaker;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\Concerns\InteractsWithActions;
|
||||
use Filament\Actions\Contracts\HasActions;
|
||||
use Filament\Schemas\Concerns\InteractsWithSchemas;
|
||||
use Filament\Schemas\Contracts\HasSchemas;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Concerns\InteractsWithTable;
|
||||
use Filament\Tables\Contracts\HasTable;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Livewire\Component;
|
||||
|
||||
class ComparingBookmakerMenu extends Component implements HasActions, HasSchemas, HasTable
|
||||
{
|
||||
use InteractsWithActions;
|
||||
use InteractsWithSchemas;
|
||||
use InteractsWithTable;
|
||||
|
||||
public $active_methode = 1;
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->description('Bookmaker higher up will be used first.')
|
||||
->headerActions([
|
||||
Action::make('top')
|
||||
->color(fn () => $this->active_methode == 1 ? 'primary' : 'gray')
|
||||
->icon('phosphor-cell-signal-full')
|
||||
->action(function ($livewire) {
|
||||
$this->active_methode = 1;
|
||||
$livewire->getTableRecords()->fresh();
|
||||
}),
|
||||
Action::make('middle')->action(fn () => $this->active_methode = 2)
|
||||
->color(fn () => $this->active_methode == 2 ? 'primary' : 'gray')
|
||||
->icon('phosphor-cell-signal-high'),
|
||||
Action::make('low')->action(fn () => $this->active_methode = 3)
|
||||
->color(fn () => $this->active_methode == 3 ? 'primary' : 'gray')
|
||||
->icon('phosphor-cell-signal-medium'),
|
||||
|
||||
])
|
||||
->query(ComparingBookmaker::query()
|
||||
->where('is_hidden', 0)
|
||||
->where('sport_id', auth()->user()->sport_id)
|
||||
->where('client_bookmaker_id', auth()->user()->bookmaker_id)
|
||||
->where('method_id', $this->active_methode))
|
||||
->columns([
|
||||
TextColumn::make('id'),
|
||||
])
|
||||
->paginated(false)
|
||||
->filters([
|
||||
// ...
|
||||
])
|
||||
->recordActions([
|
||||
// ...
|
||||
])
|
||||
->toolbarActions([
|
||||
// ...
|
||||
]);
|
||||
}
|
||||
|
||||
public function render(): View
|
||||
{
|
||||
return view('livewire.comparing-bookmaker-menu');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user