Have you seen our video tutorials? Check 'em out!

Sorting table by columns

keevitaja - 1 month ago

On what it depends, if table can be ordered by a column?

I have fields name and slug, but i can only sort by slug. Name is translatable, slug is not.

    protected $columns = [
        'name', 'slug'
    ];

ryanthompson - 1 month ago

Ya the table builders don't currently automate sorting by translatable out of the box because joining automatically can be dangerous. You can achieve this manually by defining 'sort_column' parameter for the column and making sure the column is defined in the query using 'onQuerying'.