kyslik/column-sortable
Add sortable table columns to Laravel 5.5–8. Generate clickable links in Blade, configure sortable fields and icons, and sort by related hasOne/belongsTo attributes or withCount(). Works seamlessly with pagination and query building.
created_at, status).price, rating, or name dynamically.Adopt if:
/users?sort=name:desc) for bookmarkable, shareable links.orderBy for nested relations).hasOne, belongsTo) that require sorting.Look elsewhere if:
name and date). This package handles single-column sorting per request.$sortable arrays.For Executives: "This package lets us add column sorting to our Laravel admin dashboard with zero backend development—users can click headers to sort data (e.g., ‘Newest First’ or ‘Price: Low to High’), and the URL updates automatically. This improves usability for power users (e.g., support teams, analysts) without adding technical risk. It’s battle-tested (600+ stars), MIT-licensed, and maintained for Laravel 9–13. Implementation takes <1 hour and saves us from building custom sorting logic."
For Engineers: *"Pros:
use Sortable to any Eloquent model and define $sortable = ['column1', 'column2']—done.user.detail.phone_number) with minimal config./orders?sort=total:desc), enabling sharing/bookmarking.@sortablelink('column', 'Label') generates sortable headers with icons (Font Awesome).Schema::hasColumn() checks if $sortable is defined.Cons:
Quick Start:
composer require kyslik/column-sortableuse Sortable; to your model and define $sortable = ['id', 'name'].$model->sortable()->paginate(10) in controllers.@sortablelink('name', 'Name') to Blade views.Alternatives: If you need client-side sorting, pair this with a JS library like DataTables. For multi-column sorting, consider building a custom solution."*
How can I help you explore Laravel packages today?