© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
Kigant

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([
              
            ]);
    }
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 day
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Eager loaded relationship based on table filter
FilamentFFilament / ❓┊help
3y ago
How to Eager Load Nested Relationship in table builder
FilamentFFilament / ❓┊help
2y ago
Eager loaded relationships filter
FilamentFFilament / ❓┊help
2y ago
Eager loading relationships in table
FilamentFFilament / ❓┊help
2y ago