Make text and custom fields sortable using Laravel Nova Indicator Field?

Viewed 1782

I would like to make my text and custom fields sortable. But I haven't found a single page which explains me how this works.

Either these:

Text::make('Type', function () {
    return $this->productType->name;
})
    ->sortable(),

or this is working:

Text::make('Type', function () {
    return $this->productType->name;
})
    ->sortable(function () {
        return $this->productType->name;
    }),

Do you guys have an idea how to make those text fields sortable? Also, is it possible to make custom fields sortable like this one?

Indicator::make('Status', function() {
    return $this->postStatus->status;
}),

This is from this package: https://github.com/inspheric/nova-indicator-field

Kind regards and thanks!

0 Answers
Related