© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
8 replies
Wannes

Get all sortable columns of table

Hi, I'm trying to create some automated tests. So basically I want to execute all these tests (https://filamentphp.com/docs/3.x/tables/testing), but I'm trying to automate them.

Now I'm wondering how I could get all the columns of my table which I specified with ->sortable() in my resource.

Than I can just create a loop and execute my tests based on the fields.
Installation - Panel Builder - Filament
Solution
return collect($this->getResourceTableColumns())
    ->filter(fn ($column) => $column->isSortable());
return collect($this->getResourceTableColumns())
    ->filter(fn ($column) => $column->isSortable());
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Ascending and descending sortable option overriding options of sortable columns
FilamentFFilament / ❓┊help
3y ago
TablesRenderHook after table filter / toggle columns
FilamentFFilament / ❓┊help
6mo ago
Get all the table columns from a resource
FilamentFFilament / ❓┊help
2y ago
Get rid of "Columns" icon on table
FilamentFFilament / ❓┊help
4mo ago