kyslik/column-sortable
Add sortable table columns to Laravel (5.5–8) Eloquent listings. Provides Blade helpers to generate sort links with direction icons, supports configurable sortable fields, pagination-friendly URLs, and sorting on hasOne/belongsTo relations with optional aliases.
ORDER BY clauses) while supporting complex use cases like:
addresses.city via belongsTo/hasOne).SELECT name AS username → sort by username).created_at, total_price).Adopt if:
author.name).sort=column:direction in routes/controllers).Look elsewhere if:
spatie/laravel-query-builder).name ASC, date DESC simultaneously)—this package handles single-column sorts.$sortable arrays."This package lets users sort data in our Laravel apps with a single click—no dev work required. For example, support teams can instantly sort tickets by priority or created_at without us writing custom backend logic. It’s a low-code way to add self-service data exploration to admin panels or public tools, reducing support requests and speeding up feature delivery. The MIT license and 600+ stars mean it’s battle-tested and maintainable."
ROI:
*"This is a drop-in Laravel package that handles dynamic column sorting for Eloquent models. Key benefits:
@sortablelink) generates sorted links with icons (Font Awesome).user.name or post.category.title using Eloquent relations.Implementation:
composer.json and publish config.use Sortable trait in models + define $sortable = ['column1', 'column2'].orderBy() with $model->sortable()->paginate().@sortablelink('column') in Blade for UI.Trade-offs:
sort=col1:asc,col2:desc).Alternatives considered:
Recommendation: Adopt for admin panels/dashboards. Pair with Livewire/Alpine for reactive UIs if needed."*
How can I help you explore Laravel packages today?