6

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!

navinpai
  • 955
  • 11
  • 33
Jan
  • 1,180
  • 3
  • 23
  • 60

0 Answers0