F
Filamentβ€’17mo ago
ralphredd

Multiple fields in one column

Hello, I'm looking for a way to combine 2 fields into a single column, I have a date and time in a separate DB columns but would like to show them as single table column, ie "date - time" kind of layout Thank you!
Solution:
I think you can use the state method on the input, like so: Tables\Columns\TextColumn::make('date-time') ->getStateUsing(function (Model $record): string { return $record->date . $record->time; })...
Jump to solution
5 Replies
Solution
Bruno Pereira
Bruno Pereiraβ€’17mo ago
I think you can use the state method on the input, like so: Tables\Columns\TextColumn::make('date-time') ->getStateUsing(function (Model $record): string { return $record->date . $record->time; })
Bruno Pereira
Bruno Pereiraβ€’17mo ago
Sorry I'm on the phone
ralphredd
ralphreddOPβ€’17mo ago
Yes, it worked as I wanted. Thank you very much!
Bruno Pereira
Bruno Pereiraβ€’17mo ago
No prob! Don't forget to mark it as the solution and solved πŸ™‚ happy coding
Want results from more Discord servers?
Add your server