Skip to content

Add configurable sorting - #45

Merged
andreia merged 2 commits into
mainfrom
add_sort
Oct 30, 2026
Merged

andreia merged 2 commits into
mainfrom
add_sort

Conversation

@andreia

@andreia andreia commented Oct 30, 2026

Copy link
Copy Markdown
Member

Details

Add configurable sorting.

Library listings default to folders first, then files and links. Each group is alphabetical, including inside every folder. People can still click a column to choose a different order for that table.

use Tapp\FilamentLibrary\Enums\LibrarySort;
use Tapp\FilamentLibrary\FilamentLibraryPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            FilamentLibraryPlugin::make()
                ->defaultSort(LibrarySort::FoldersThenName),
                // ->defaultSort(LibrarySort::Name)
                // ->defaultSort('created_at', 'desc')
                // ->defaultSort(fn ($query, string $direction) => $query->orderBy('name', $direction)),
        ]);
}

@andreia
andreia requested review from scottgrayson and swilla and removed request for scottgrayson October 30, 2026 01:32
@andreia
andreia merged commit 647c33d into main Oct 30, 2026
9 checks passed
@andreia
andreia deleted the add_sort branch October 30, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant