Help Needed with Sorting an Accessor in Filament Table
I'm working on a Filament table where I need to display and sort by a computed accessor,
Account model:
Filament table column:
The problem is that when I try to sort by
formatted_ending_balance, in my Account model. The accessor calculates the ending balance based on account transactions and formats it.Account model:
Filament table column:
The problem is that when I try to sort by
formatted_ending_balance, I get a SQL error because this accessor is not a database column. How can I enable sorting for this computed accessor in the Filament table? Is it currently possible? Any possible workarounds or similar solutions? Making it a database column is not an option for me based on my app logic. Thanks.Solution
You can’t. Sorting is done on DB level. If a db column is not an option you can sort.