Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Column Sortable Laravel Package

kyslik/column-sortable

kyslik/column-sortable adds easy column sorting to Laravel 5.5–8 apps. Use Blade helpers to generate sortable links, configure sortable columns, and sort by related hasOne/belongsTo fields, with override and alias options for custom queries.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for table UX: This package turns a recurring, low-differentiation feature — clickable column sorting on paginated Eloquent lists — into a near-zero-effort capability. The buy decision is easy: MIT license, small integration surface, and no infrastructure cost. The real decision is whether the product needs sorting at all versus a more complete table experience.
  • Feature scoping for admin and internal tools: Best fit is CRUD index pages, back-office tables, reporting lists, and directory-style views where users expect “click header to sort.” It supports default sort directions, URL-driven sort state, pagination preservation, relation sorting (hasOne/belongsTo), aliases, and withCount() sorting — enough to cover most MVP table requirements without a front-end table library.
  • Roadmap sequencing: Adopt early when shipping list-heavy screens; defer when the roadmap points to SPA, Inertia, or API-first clients, where server-rendered Blade sort links add less value. Sorting is a fast UX win, but it is not a differentiator and should not displace higher-value roadmap work.
  • Consistency and design-system leverage: The Blade directive centralizes sort-link markup, icon classes, and query-string behavior. That supports a product decision to standardize table interactions across screens and avoid one-off sorting implementations drifting in behavior and appearance.
  • Risk and maintenance budgeting: Recent releases track Laravel compatibility through 13.x, which reduces upgrade risk, but the README still says “Laravel 6.x” and “5.5–8” in places. A PM should budget a small validation spike per Laravel upgrade and treat version compatibility as a tracked dependency, not an assumed guarantee.
  • Security and abuse handling as product requirements: Sorting is driven by user-controlled GET parameters. The package provides column whitelisting through $sortable and a custom exception for malformed input, but the product decision is to require whitelisting and exception handling in the acceptance criteria — otherwise sorting becomes an injection or 500-error vector.
  • Analytics and discoverability: Sortable links are crawlable, parameterized URLs. If public-facing, decide whether sorted variants should be indexed, canonicalized, or excluded; for internal tools, capture sort usage to learn which columns matter and inform table redesign.

When to Consider This Package

  • Strong fit:
    • The application is Laravel 5.5 through 13.x and uses server-rendered Blade views.
    • You have paginated Eloquent index pages and want sorting in hours, not days.
    • You need relation sorting or aliased/count-based sorting without hand-writing joins.
    • The team is small and prefers a permissive, removable dependency over custom table infrastructure.
    • You want a consistent, configurable sort-link pattern with minimal front-end work.
  • Weaker fit or look elsewhere:
    • The product is API-first or SPA-based and sorting belongs in query parameters handled by a headless table component.
    • You need multi-column sort, saved sort preferences, complex faceted filtering, or server-side table state beyond a single column and direction.
    • You are on a Laravel version outside the supported range, or you need a formal support contract and SLA.
    • You require extensive customization of sort UI, accessibility semantics, or non-Eloquent query builders.
    • The table is very large and sorting performance depends on indexes, computed columns, or database-specific behavior that a generic trait cannot reason about.
    • You need a broad ecosystem signal: the package has a modest star count and no downstream dependents, so it should be treated as a focused utility, not a platform dependency.
  • Adoption criteria: Confirm current Laravel compatibility, run a spike on one representative table including a relation sort, verify exception handling for malformed sort parameters, and confirm column whitelists in every model.

How to Pitch It (Stakeholders)

  • To executives: This is a free, MIT-licensed utility that ships a common UX expectation — sortable tables — without adding headcount, vendor cost, or architectural commitment. It is small, replaceable, and low-risk. The trade-off is modest maintenance diligence, not strategic lock-in.
  • To engineering: Use the Sortable trait with an explicit $sortable whitelist, call sortable() before paginate(), render headers with @sortablelink(), and catch ColumnSortableException for user-controlled input. It supports relation sorting, aliasing, and custom orderBy overrides for edge cases. Pin the package version and verify compatibility during Laravel upgrades.
  • To design and product: It standardizes sortable-header behavior and icon states through configuration, reducing bespoke UI work. It does not replace a full data-grid strategy; if the roadmap requires multi-sort, saved views, or rich filtering, plan a separate table component rather than stretching this package beyond its scope.
  • Recommendation: Adopt for Blade-based admin and internal list screens with straightforward single-column sorting. Do not adopt as the foundation of a public-facing, high-scale, or highly interactive data product without a validation spike and a fallback plan to implement sorting directly in the query layer.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log