ibrahimbougaoua/filament-sort-order
filament-sort-order is a Laravel/Filament package that adds drag-and-drop sorting to Filament tables. Configure an order column, enable reordering in your resource, and persist row positions automatically.
Architecture fit. The package is a thin Filament plugin: a service provider registration plus table-level sortable/reorderable behavior and a persistence handler that writes new positions back to a configured column. This is an additive UI-layer concern, not an architectural change — it touches a resource table definition and one existing integer column. For a Laravel + Filament admin, that is about as low-coupling as a dependency gets. The risk is directionally the opposite of "invasive": it is tightly coupled to Filament internals, specifically the table row-reordering/Alpine drag-and-drop surface, which has moved between Filament 2 and 3 and will move again. Treat the package as a version-locked extension of your Filament minor, not as an independent library.
Integration feasibility. High, conditional on three things being true up front: (1) the target panel is Filament v3.x (verify the composer constraint rather than trusting the README); (2) a sort/position integer column already exists or can be added — "no extra migrations required" means the package ships none, you still own the schema and backfill; (3) the resource's ordering is single-scope (no per-parent or per-tenant sequences) unless you confirm scoping support. Setup is a panel registration plus a table modifier and a default sort — hours, not days.
Technical risk.
update policy/authorization and tenant scoping — if not, an editor who can see a row may be able to reposition it.Key questions for the maintainer spike.
Stack fit. Laravel 10/11, PHP 8.1+, Filament v3 with Livewire/Alpine. If the package ships pre-built assets, it drops in with no frontend toolchain change. If it requires a Vite build step into the panel's theme, that is a real integration cost for us and should be checked on day one.
Migration path.
sort_order as a non-nullable integer with a sensible default; add a composite unique index on (scope_column, sort_order) where scope is parent_id/tenant_id or a constant for flat lists.ROW_NUMBER() OVER (PARTITION BY scope ORDER BY <existing criterion>)), spaced by 100 to leave insertion gaps.sort_order ascending with a stable secondary key (id) so pagination is deterministic.Compatibility. Pin the exact package version and the Filament minor together in composer.json; add a CI job that runs the panel's test suite against the pinned pair. Do not let this float on ^3.0.
Sequencing. (a) Maintainer Q&A on authorization and write semantics; (b) schema and backfill in a migration we own; (c) spike on the lowest-risk resource (FAQ/categories); (d) characterization tests asserting order after a simulated drop, including a filtered view and a two-user concurrent drop; (e) roll out to menus/categories; (f) revisit for other resources only if the ordering contract held.
Maintenance. Low runtime maintenance, moderate upgrade maintenance. Budget a recurring task each Filament minor: verify drag-drop still works, verify asset publishing. Own the fork path — keep a vendored copy or a fork under our org with the ability to patch the authorization check ourselves. Total cost of ownership is dominated by the one-time schema/backfill and the tests, not by the dependency.
Support. Community-only, no SLA, effectively no issue triage guarantee. Blast radius is contained: the failure mode is a broken admin interaction on a handful of resources, not a production outage. That said, do not put it on any resource whose ordering is business-critical without the characterization tests.
Scaling. Reads are cheap (indexed integer sort). Writes are the concern: dense renumbering on a drop is O(n) updates and serializes on row locks; on tables in the low thousands this is invisible, on tens of thousands it is a latency and contention problem. Prefer sparse ordering with gap-insertion if the package supports it, otherwise restrict enablement to small, low-churn lists. Pagination plus reordering is a UX hazard — editors reordering page 1 of 12 may not understand they are renumbering against the full set.
Failure modes to instrument. Silent divergence between UI and DB after a failed drop (the grid looks reordered, the database is not) — add a post-drop reload or a toast on persistence error. Duplicate or null sort values causing non-deterministic ordering. Reorder requests that bypass tenancy scope. Sort column type drift (string vs integer) producing lexical ordering ("10" before "2"). Concurrent edits producing lost reorderings — accept and document, or add a version/updated_at check.
Ramp-up. Under a day for a developer already fluent in Filament resource/table configuration; the documentation surface is small enough to read end-to-end. The real ramp-up cost is institutional knowledge: write down the ordering contract (what the column means, whether it is global or scoped, what happens with filters, who may reorder) and put it in the resource's docblock, or the next developer will re-derive it by experimentation. Editors need one line of guidance — reorder within a filtered, paginated view is the single most likely source of "why did my order change" tickets.
How can I help you explore Laravel packages today?