Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

esnare's avatar

Default sort for a column on Nova - Only when clicked on it

Hi There,

I have a resource on Laravel Nova that exposes these three columns User id, User name and User Age.

All these columns are sortable, using the ->sortable() function from Nova.

Nevertheless, when I click on the age column, the default sort value is ASC. In fact, that's the default value for all the sortable columns on Nova. Therefore, the table will be ordered by the younger users per default.

I'd like to change this behaviour, I'd like to click on the Age column and show the older users first. In other words, add a DESC value per default when clicking on the Age column for the first time.

Bear in mind that I don't need this value to be the default when I go to the resource page, the current default value is for the user id (using ASC) which is fine.

I ONLY need this sorting when the user clicks on the age column. The OTHER columns are fine with the default values.

Is that possible

Hope that makes sense.

Thanks in advance.

0 likes
2 replies

Please or to participate in this conversation.