Sortable on accessor column #13948
Unanswered
gregoryloichot
asked this question in
Help
Replies: 1 comment 1 reply
-
You can’t use sortable or searchable in accessors because these methods rely on the actual table columns. ->sortable(function (Builder $query) {
return $query...;
}) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Package
Table builder
Package Version
v3.2
How can we help you?
Hello,
I'm trying to make a column sortable, but I get error.
This is my column 👍
My accessor in the model :
The display is completely fine, the values are correct in the column.
According to the doc (https://filamentphp.com/docs/3.x/tables/columns/getting-started#sorting) this should also work with accessors…
But, when I try to sort the column, I get an SQL error telling me that the column 'is_completed' does not exist (and it is true). So it looks like it ignores the accessor when sorting.
Any ideas ? Did I miss anything ?
Beta Was this translation helpful? Give feedback.
All reactions