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
Is the value in the database?
no, it is not in database, just extra column to show amount as information to user
Where is the value coming from then? Is it hard coded?
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
or format the state => TextColumn::make('amount')->formatStateUsing(fn(Model $record) => $record->custom_amount)
Yeah also good option