How to refer to my own data in a table layout

I'm trying to conditionally hide data. In the below example, when 'credit' is null or zero, the field must value must be blank. Please assist.
Tables\Columns\TextColumn::make('credit')
->money(app(AllSettings::class)->default_currency)
->alignRight()
->sortable()
->hidden(fn (Model $record) => $record->credit == 0),
Tables\Columns\TextColumn::make('credit')
->money(app(AllSettings::class)->default_currency)
->alignRight()
->sortable()
->hidden(fn (Model $record) => $record->credit == 0),
2 Replies
Eugene van der Merwe
What I mean is at the moment that shows EUR 0 I don't want it to show anything, it must just be blank. I managed this using the $state and a helper, example:
->formatStateUsing(fn (string $state): string => helper($state))
->formatStateUsing(fn (string $state): string => helper($state))
Apologies, how do I mark this again as solved?
krekas
krekas16mo ago
right click on the message go to apps and press mark
Want results from more Discord servers?
Add your server