F
Filament5mo ago
Weccop

Align two TextColumns next to each in a split / stack

Is it possible to align two TextColums next to each other? I have this at the moment: Summer 2024 01-07-2024 31-07-2024 But I want to have it like: Summer 2024 01-07-2024 31-07-2024 Is this possible with the table builder in Filament? This is what I have at the moment:
Split::make([
Stack::make([
TextColumn::make('season.name')
->label(__('Season')),

Stack::make([
TextColumn::make('season.start_date')
->color('gray')
->date('d-m-Y'),
TextColumn::make('season.end_date')
->color('gray')
->date('d-m-Y'),
])
]),
])
Split::make([
Stack::make([
TextColumn::make('season.name')
->label(__('Season')),

Stack::make([
TextColumn::make('season.start_date')
->color('gray')
->date('d-m-Y'),
TextColumn::make('season.end_date')
->color('gray')
->date('d-m-Y'),
])
]),
])
Solution:
TextColumn::make(‘custom_date’)
->getStateUsing(fn ($record) => $record->season->start_date . ‘ ‘ . $record->season->end_date)
TextColumn::make(‘custom_date’)
->getStateUsing(fn ($record) => $record->season->start_date . ‘ ‘ . $record->season->end_date)
...
Jump to solution
2 Replies
Solution
awcodes
awcodes5mo ago
TextColumn::make(‘custom_date’)
->getStateUsing(fn ($record) => $record->season->start_date . ‘ ‘ . $record->season->end_date)
TextColumn::make(‘custom_date’)
->getStateUsing(fn ($record) => $record->season->start_date . ‘ ‘ . $record->season->end_date)
Weccop
Weccop5mo ago
Thx. That solved it 🙂