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

Filament Sort Order Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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.

  • Bus factor 1 / low adoption. 22 stars, one maintainer, last release 2024-09-24. No evidence of CI, test coverage, or a documented support matrix. Assume no upstream fixes; the MIT license is your mitigation (vendor or fork).
  • Authorization surface. The drag-drop persistence almost certainly hits a dedicated endpoint separate from normal resource update routes. Confirm it re-applies the resource's update policy/authorization and tenant scoping — if not, an editor who can see a row may be able to reposition it.
  • Write semantics. Determine whether a drop issues N per-row PATCHes or one batched payload, whether it runs in a transaction, and whether it renumbers densely or sparsely. Per-row dense renumbering on a large table is a write-amplification and lock-contention problem, and a partial failure leaves a corrupted sequence.
  • Concurrency. Two editors reordering the same list will produce last-write-wins order loss. No optimistic locking is implied by the description.
  • Correctness edge cases. Filtered/paginated views: does reordering a subset renumber globally or only within the visible slice? Tie-breaking when duplicate sort values exist. Soft-deleted rows holding positions. Behavior when the sort column is nullable.

Key questions for the maintainer spike.

  1. Which Filament major/minor versions are supported, and what is the stated upgrade policy?
  2. Does the persistence endpoint enforce Filament's resource authorization and tenancy scoping?
  3. Is persistence transactional and batched, or per-row? Does it renumber densely or leave gaps?
  4. How does reordering behave with active table filters, pagination, and a non-global sort scope?
  5. Are there tests, and is there a CI matrix across Filament versions?
  6. Does it ship compiled assets, or does it require a JS build step in our pipeline?

Integration Approach

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.

  1. Add 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.
  2. Backfill deterministically (ROW_NUMBER() OVER (PARTITION BY scope ORDER BY <existing criterion>)), spaced by 100 to leave insertion gaps.
  3. Set the table's default sort to sort_order ascending with a stable secondary key (id) so pagination is deterministic.
  4. Register the plugin on a single low-risk resource first, behind a feature flag per resource.
  5. Wrap the table modifier in our own small trait/helper so the package call site is one file and swappable.

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.

Operational Impact

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.

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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource