Make a relation count field sortable in Nova

Posted 4 months ago by michael1986

Hi all,

I'd like to know if it's possible to make a relation count field sortable in Nova.

Number::make(__('Categories'), function () {
    return $this->categories->count();
}),

Obviously adding ->sortable() doesn't work here.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.