Equivalent of novas computed fields?

Just wondering if there is a filament equivalent of computed fields for the table builder: https://nova.laravel.com/docs/4.0/resources/fields.html#computed-fields I can see that you can use ViewFields but this seems overkill when i just want to return some textual information where a closure would suffice
Fields | Laravel Nova
Master Your Universe
Solution:
Do you mean in a table? You can just use a TextColumn. i.e.
TextColumn::make('full_name')->getStateUsing(fn (Model $record): string => "{$record->first_name} {$record->last_name}")
TextColumn::make('full_name')->getStateUsing(fn (Model $record): string => "{$record->first_name} {$record->last_name}")
...
Jump to solution
3 Replies
Solution
oddvalue
oddvalue4mo ago
Do you mean in a table? You can just use a TextColumn. i.e.
TextColumn::make('full_name')->getStateUsing(fn (Model $record): string => "{$record->first_name} {$record->last_name}")
TextColumn::make('full_name')->getStateUsing(fn (Model $record): string => "{$record->first_name} {$record->last_name}")
yandos666
yandos6664mo ago
Ah Awesome thanks @oddvalue getStateUsing seems to be the one!
Want results from more Discord servers?
Add your server
More Posts