© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•6mo ago•
40 replies
Kyle

Dynamic Fields in a Repeater Table

Hi! I Know everyone is busy so I'll try my best to keep this short.

I have a Repeater that is configured to show as a table.

Repeater::make('player_stats')
  ->table([
    TableColumn::make('Data'),
    TableColumn::make('Value'),
    TableColumn::make('Date')
  ])
  ->schema([
    Select::make('data')
      ->options(...)
      ->required()
      ->live(),
    TextInput::make('value')
      ->required()
      ->visible( fn (Get $get) => $get('data') == '1' ),
    Select::make('select_value')
      ->required()
      ->options( ... )
      ->visible( fn (Get $get) => $get('data') == '2' ),
    DatePicker::make('date')
      ->required(),
  ])
Repeater::make('player_stats')
  ->table([
    TableColumn::make('Data'),
    TableColumn::make('Value'),
    TableColumn::make('Date')
  ])
  ->schema([
    Select::make('data')
      ->options(...)
      ->required()
      ->live(),
    TextInput::make('value')
      ->required()
      ->visible( fn (Get $get) => $get('data') == '1' ),
    Select::make('select_value')
      ->required()
      ->options( ... )
      ->visible( fn (Get $get) => $get('data') == '2' ),
    DatePicker::make('date')
      ->required(),
  ])


The problem is that, even if a field is not visible, the field still uses the column, so with only 3 TableColumns, the DatePicker doesn't show. I also tried variations of hide(), visible(), disabled(), and dehydrated() and each field always uses one column of the table.

I read that it is possible to use a function instead of an array as a schema, so that the function can compute and return which fields will exist. However, that relies on the fact that the value used to decide which fields are shown exist outside of the schema. In my case, I want the schema to be determined by the value of the data field inside the schema itself.

Is there a way to implement this? If not, what is the best approach, while keeping the same table structure? My approach actually works with the Table Repeater component by AWCodes. But I'd rather use the official V4 version of a table repeater if possible.

Any recommendations are greatly appreciated! Thank you!!\
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Dynamic default repeater fields
FilamentFFilament / ❓┊help
16mo ago
dynamic repeater fields names
FilamentFFilament / ❓┊help
17mo ago
Repeater "Table" with dynamic columns
FilamentFFilament / ❓┊help
8mo ago
Dynamic Repeater
FilamentFFilament / ❓┊help
3y ago