A calculated column in the table
How to display a column in the table that is calculated in the model? I was able to display but when sorting I get an error that the column does not exist in the DB
2 Replies
You should either use the sortable method to customise the way it performs the query, or you should consider using a virtual column on the table https://filamentphp.com/docs/3.x/tables/columns/getting-started#sorting
I get an error that the column does not exist in the DBYou can't sort by model attributes as sorting happens on the DB. You could use a Virtual Column in MySQL instead