Table apply filter in a eager load relationship
public function table(Table $table): Table
{
return $table
->query(
Address::query()->with('visits')
)
->columns([
TextColumn::make('folder.name')
->sortable(),
TextColumn::make('street')
->searchable(),
VisistsColumm::make('visits')]) // 2021-01-01, 2021-02-03 ....
->filters([
Filter::make('date')
->form([
DatePicker::make('visit_date'),
])
// what to do here to get the visits where the date = visit_date
], layout: FiltersLayout::AboveContent)
->actions([
])
->bulkActions([
]);
}
I would like to have a date filter. So when i change the date it would show just the visits where the "date" === visit_date
Ex: address 1 have visits days 1,2,3,4,5. So the date is day 3, i should see just
Address 1 => 3. on my table. How can i do that. It is taking me the hole day0 Replies