mapping search wip (stuck)
This commit is contained in:
1 parent
ea91af51fa
commit
b475d78f43
14 files changed
+126
-33
No files matched your search
@@ -26,19 +26,24 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
use InteractsWithSchemas;
|
||||
use InteractsWithTable;
|
||||
|
||||
protected $listeners = [
|
||||
'reload_data' => '$refresh',
|
||||
];
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->query(Event::query()->where('betradar_id', 0))
|
||||
->columns([
|
||||
MapperLeftColumn::make('left')->label(''),
|
||||
])->searchable(['home.name', 'away.name'])
|
||||
])
|
||||
->searchable(['competition_group.name', 'home.name', 'away.name'])
|
||||
->defaultPaginationPageOption(5)
|
||||
->filters([
|
||||
SelectFilter::make('country_id')
|
||||
->relationship('country', 'name')
|
||||
->options(
|
||||
fn (Builder $query) => $query->whereNotNull('events.country_id')->where('events.betradar_id', 0)->where('events.starttime', '>', Carbon::now())
|
||||
fn (Builder $query) => $query->where('countries.tx_id', 'events.country_id')->where('events.betradar_id', 0)->where('events.starttime', '>', Carbon::now())
|
||||
)
|
||||
->searchable()
|
||||
->preload()
|
||||
@@ -63,11 +68,19 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
->placeholder('League')
|
||||
->label('Leagues'),
|
||||
], layout: FiltersLayout::AboveContent)
|
||||
->hiddenFilterIndicators()
|
||||
// ->hiddenFilterIndicators()
|
||||
->filtersFormColumns(3)
|
||||
->deferFilters(false)
|
||||
->toolbarActions([
|
||||
// ...
|
||||
Action::make('reload_data_left')
|
||||
->hiddenLabel()
|
||||
->color('gray')
|
||||
->icon('phosphor-x')
|
||||
->action(function (Component $livewire) {
|
||||
$livewire->resetTableFiltersForm(); // Clears all filters
|
||||
$livewire->tableSearch = ''; // Clears the main search bar
|
||||
$this->dispatch('reload_data');
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user