Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filamentβ€’3y agoβ€’
3 replies
d3v1anX

Two TextColumns from same field

Hey guys,
I tried to add two TextColumns from the same date field. One with only date, the other with the time.

Looks like this:
  Tables\Columns\TextColumn::make('start')
      ->label('Start date (UTC)')
      ->date()
      ->sortable()
      ->searchable(),
  Tables\Columns\TextColumn::make('start')
      ->label('Start time (UTC)')
      ->time()
      ->sortable(),
  Tables\Columns\TextColumn::make('start')
      ->label('Start date (UTC)')
      ->date()
      ->sortable()
      ->searchable(),
  Tables\Columns\TextColumn::make('start')
      ->label('Start time (UTC)')
      ->time()
      ->sortable(),


there only the second field will be displayed.

I tried to change the name and use state for displaying data - this will display both fields, but then it is not sortable / searchable, because the sort field is used from "make".

Tables\Columns\TextColumn::make('start date')
    ->state(fn (Model $record) => $record->start)
    ->label('Start date (UTC)')
    ->date()
    ->sortable()
    ->searchable(),
Tables\Columns\TextColumn::make('start')
    ->label('Start time (UTC)')
    ->time()
    ->sortable(),
Tables\Columns\TextColumn::make('start date')
    ->state(fn (Model $record) => $record->start)
    ->label('Start date (UTC)')
    ->date()
    ->sortable()
    ->searchable(),
Tables\Columns\TextColumn::make('start')
    ->label('Start time (UTC)')
    ->time()
    ->sortable(),

Is my approach to display two fields of one column correct? Or am I missing something? πŸ™‚

Thank you very much!
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

Two fieldsets for the same relationship on two wizard steps not working
FilamentFFilament / β“β”Šhelp
2y ago
Align two TextColumns next to each in a split / stack
FilamentFFilament / β“β”Šhelp
3y ago
Multi field FieldComponent
FilamentFFilament / β“β”Šhelp
2y ago
Problem with two select fields using same relationship
FilamentFFilament / β“β”Šhelp
3y ago