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..
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?
Solution:Jump to solution
Or you can create Accessor (https://laravel.com/docs/11.x/eloquent-mutators#accessors-and-mutators) or local scope (https://laravel.com/docs/11.x/eloquent#local-scopes)
6 Replies
Check the column which is available in the table, eg:
make('updated_at')->label('Qty')->formatState...
Solution
Or you can create Accessor (https://laravel.com/docs/11.x/eloquent-mutators#accessors-and-mutators) or local scope (https://laravel.com/docs/11.x/eloquent#local-scopes)
It looks like you display the count of
sukses()
relationship.. so suggest you to checkout Relationship column https://filamentphp.com/docs/3.x/tables/columns/relationshipsWhat if need more custom state column but I already used all available table column?
I already suggested most of the options
thanks for your suggestions π