© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
Quentin

Not able to filter table on custom livewire component

What I am trying to do:
I try to filter a table implemented in a custom livewire component.
What I did:
I added the HasTable and HasForm contracts and the useInteractsWithTable and the useInteractsWithForm traits in my custom livewire component.
I also implemented the table function, my records are well retrieved and displayed then i added a SelectFilter to filter on a category field.
My issue/the error:
When i use my filter nothing happens and i have no errors, the filter does not appears in the table header, the query strings are not updated and ofcourse my table is not filtered. The same table is working great in admin panel.

$table
  ->relationship(fn (): HasMany => getAsUser()->profile->products())
  ->recordTitleAttribute('wording')
  ->emptyStateDescription('Ajouter un produit pour commencer')
  ->headerActions([
  ])
  ->columns([
      TextColumn::make('wording')
          ->label('Libellé')
          ->weight(FontWeight::Bold)
          ->sortable(),
      TextColumn::make('category')
          ->label('Catégorie')
          ->badge()
          ->sortable()
          ->toggleable(),
      TextColumn::make('created_at')
          ->label('Date d\'ajout')
          ->date('d/m/Y', \getAsUser()->timezone)
          ->sortable(),
  ])
  ->filters([
      SelectFilter::make('category')
          ->label('Catégorie')
          ->options(ProductCategory::class)
          ->native(false)
  ])
  ->actions([
  ])
  ->bulkActions([
  ]);
$table
  ->relationship(fn (): HasMany => getAsUser()->profile->products())
  ->recordTitleAttribute('wording')
  ->emptyStateDescription('Ajouter un produit pour commencer')
  ->headerActions([
  ])
  ->columns([
      TextColumn::make('wording')
          ->label('Libellé')
          ->weight(FontWeight::Bold)
          ->sortable(),
      TextColumn::make('category')
          ->label('Catégorie')
          ->badge()
          ->sortable()
          ->toggleable(),
      TextColumn::make('created_at')
          ->label('Date d\'ajout')
          ->date('d/m/Y', \getAsUser()->timezone)
          ->sortable(),
  ])
  ->filters([
      SelectFilter::make('category')
          ->label('Catégorie')
          ->options(ProductCategory::class)
          ->native(false)
  ])
  ->actions([
  ])
  ->bulkActions([
  ]);


Thank you in advance for your answers and sorry for the bad english.
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

Livewire table component searchable() / sortable/filter not working
FilamentFFilament / ❓┊help
2y ago
Change Filter Position on a custom table component
FilamentFFilament / ❓┊help
2y ago
Adding tabs to a table on a custom livewire component
FilamentFFilament / ❓┊help
11mo ago
Adding table to Livewire Component
FilamentFFilament / ❓┊help
3y ago