Laravel Nova sortable fields

59 views Asked by At

In Laravel Nova, I am able to sort fields of a resource from ascending to descending order, however, after I click on the arrows to sort from descending to ascending order, it's not making the request. Is there a way to resolve this?

I'd also like to ask if there is a way to add a clear state for sorting, if ascending and descending are representing by arrows in the table heading, in the middle, I want to add a "-" which will help the user clear request back to the resource index, is this possible?

It seems like this only works for BelongsTo() field in my case where the user can switch back and forward, but for other fields, the user can only switch from asc to desc, and then they're stuck and can't click to switch back from desc to asc. I've searched for solutions and it seems that people are suggesting to override the indexQuery(), however, that did not work.

0

There are 0 answers