FilamentF
Filament2y ago
dyo

Problem with formatStateUsing in TextColumn of custom table attribute

I just upgrading filament v2 to v3, but I got issue in textcolumn class with formatStateUsing method..
Tables\Columns\TextColumn::make('qty')->formatStateUsing(function ($record) {
    $qty = Konfirmasi::where('trans_ref', $record->id)->sukses()->count();
    return number_format($qty, 0);
}),

The qty attribute is not in table schema..
I need extra column to show the custom query..
In v2, the code above is working, but in v3, the column is returned blank..

What should I do to make it work in v3?
Was this page helpful?