multiple values for default sort on tables

In this question somone suggested this method

protected function applyDefaultSortingToTableQuery(Builder $query, string $sortColumn, string $sortDirection): Builder
{
    return $query
        ->orderBy('category', 'ASC')
        ->orderBy('title', 'ASC');
}


❓┊helpFor defaultSort() which accepts a string, is there an easy way to sort by multiple columns?

I don't see this in documentation for V3, is this still doable?


When I added it MilestoneResource.php nothing happens

    protected function applyDefaultSortingToTableQuery(Builder $query, string $sortColumn, string $sortDirection): Builder
    {
        return $query
            ->orderBy('status', 'asc')
            ->orderBy('created_at', 'asc');
    }


When I added to a page like ListMilestones.php i get this error
27429b95c7a102a704ceb03e5dda3d4c.png
Was this page helpful?