konsulting/laravel-sorting
konsulting/laravel-sorting adds simple, request-driven sorting to Laravel Eloquent queries. Define sortable columns, read sort parameters from the query string, and keep controllers clean with reusable sorting logic for tables and API endpoints.
Request::get() with input(), keeping the package clean on symfony/http-foundation 7.4 / Laravel 13. This is a dependency-health signal for roadmap decisions about when the platform can move to Laravel 13 — a sorting package still calling get() would otherwise add deprecation noise or become an upgrade blocker.?sort[]=x now falls back to the default sort instead of throwing a TypeError (a 500). That converts a user-triggerable server error into graceful degradation — directly relevant to error-tracking noise, SLOs, and whether public list endpoints can accept arbitrary query strings.?sort=field / ?sort=-field semantics. Not sufficient on its own for multi-key ordering with per-user persisted preferences.Adopt when:
Look elsewhere (or build in-house) when:
Executives: This is a maintenance-grade release, but the right kind — it keeps us current with Laravel 13 and stops malformed requests from producing server errors. Small effort, lower upgrade risk, less error noise.
Engineering: 0.1.11 stops using Request::get() (deprecated in symfony/http-foundation 7.4, shipped with Laravel 13) in favor of input(), and coerces non-string sort values — e.g. ?sort[]=x — to the default sort instead of raising a TypeError. No caller-facing API change. Two caveats: we're on a 0.x line, so pin the version and watch minor releases; and the fallback is silent, so if we want client-visible validation on bad sort params we must add it ourselves.
How can I help you explore Laravel packages today?