outl1ne/nova-sortable
Laravel Nova package that adds drag-and-drop reordering to resource index and HasMany views, powered by Spatie's eloquent-sortable. Supports pivot tables, move-to-start/end arrows, per-resource sorting control, and localization.
eloquent-sortable collapses that to roughly half a day to one day per resource (migration, backfill, trait, resource config, QA).HasMany detail views (agenda items, gallery images, FAQ entries) and BelongsTo/MorphsTo relationships with pivot ordering, which is where most homegrown implementations break.eloquent-sortable, the persistence logic is a widely used, independently maintained library; the package only contributes the Nova UI. Worst case, the UI is replaceable without touching the data model — that's a meaningful escape hatch for a buy decision.HasMany and pivot-backed relationships; backfilled sort_order matches existing display order so nothing visually changes on deploy; operations are safe on the current largest list in production.Adopt when most of these are true:
laravel/nova: ^5.0, so it is not a reason to adopt Nova, only a reason to use Nova better.HasMany view or pivot-based (BelongsTo/MorphsTo) reordering. That's the differentiated capability and the part most teams underestimate when building in-house.id (the README's own migration path), with no external system already depending on that order.Look elsewhere when:
eloquent-sortable directly with a native drag-and-drop UI. Adopting Nova to use this package is backwards.eloquent-sortable yourself.Risk register to carry into the design review:
| Risk | Likelihood | Mitigation |
|---|---|---|
| Nova major upgrade breaks compatibility | Medium | Pin Nova, test in staging on upgrade, budget a small maintenance line item per upgrade cycle |
| Reorder writes degrade on large tables | Medium | Cap list size for drag-and-drop; fall back to a numeric "position" field for large sets |
| Order column drifts / gaps accumulate | Low | Let Spatie's library manage rebalancing; don't hand-write order values |
| Maintainer bandwidth | Low–Medium | MIT + forkable; persistence layer is Spatie's, so the blast radius is UI only |
For executives (one paragraph): Our admin runs on Laravel Nova, which we already license. This is a free, MIT-licensed add-on that lets our content and merchandising team control the order items appear in — homepage rails, menus, featured lists, gallery items — by dragging and dropping, instead of filing an engineering ticket. It's a thin layer over a widely used open-source sorting library, so there's no lock-in and essentially no licensing cost. Estimated integration is under a day per resource. The value is speed: the team that owns the content can change what customers see first without waiting on a sprint.
For engineering (the ask):
Add outl1ne/nova-sortable, add an integer sort_order column, backfill it from id so display order is unchanged on deploy, apply Spatie's Sortable trait to the model, and register the sortable index/HasMany field in the Nova resource. Confirm behavior on pivot-backed relationships if we use them. Constraint to respect: this is for human-curated order only — if a list can exceed a few hundred rows or the order should be computed, we scope that differently rather than stretching this.
The decision, stated plainly: approve as a low-cost, low-risk capability for editor-controlled ordering on Nova, with an explicit boundary that it is not our answer for algorithmic ranking, large datasets, or audited ranking changes.
How can I help you explore Laravel packages today?