F
Filament15mo ago
nuumaan

How can I pass a custom value for a TextColumn

I want to pass a custom value to TextColumn::make('amount')->money('usd') May be i can do something like TextColumn::make('amount', 'custom_amount')->money('usd') Could anyone assist please
6 Replies
Thijmen
Thijmen15mo ago
Is the value in the database?
nuumaan
nuumaanOP15mo ago
no, it is not in database, just extra column to show amount as information to user
GDG
GDG15mo ago
Where is the value coming from then? Is it hard coded?
Thijmen
Thijmen15mo ago
You can mutate data on the list page That way you can do some calculations in the mutate function and put it in the column
ED
ED15mo ago
or format the state => TextColumn::make('amount')->formatStateUsing(fn(Model $record) => $record->custom_amount)
Thijmen
Thijmen15mo ago
Yeah also good option
Want results from more Discord servers?
Add your server