subtract 2 column table

Hello, i have 2 column like this
TextColumn::make('quota')->label('Quota'),
TextColumn::make('participant_count')->counts('participant')->label('Terisi'),


i want to subtraction between Quota and Terisi, and make only 1 column. How can i achieve that in Filament? Thank you!
image.png
Solution
Now this is work, @charleswilfriedk thank youuu!!!
TextColumn::make('participants')
->formatStateUsing(fn(ClassChoice $record) => $record->quota-$record->participants->count()),


relation name must plural because using hasMany
Was this page helpful?