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

Nova Sortable Laravel Package

optimistdigital/nova-sortable

A Laravel Nova package for drag-and-drop sorting of resource records in index tables. Add a sortable trait and field, then reorder rows directly in Nova with minimal setup. Ideal for models using an order or sort_order column.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package is a thin, additive Nova extension: a model trait plus a Nova field that renders drag handles in the resource index and persists a sort_order integer. It does not alter your domain model, introduce new services, or impose runtime infrastructure. For any Nova-backed admin where editors need manual merchandising order (CMS pages, FAQs, navigation items, menu categories), this is a near-perfect architectural fit — it solves one narrow problem at the presentation layer and stays out of the way of the rest of the application.

Integration feasibility. Low. The work is: composer require, a migration adding a nullable integer sort column, a trait on the model, one field entry in the resource's fields() method, and a published asset. Realistically a half-day for a developer familiar with Nova, plus migration/backfill time. There is no API surface, no queue, no external service. The main unknown is not effort but fit with your existing ordering semantics.

Technical risk. Moderate and concentrated in four places:

  1. Nova version coupling. Nova is closed-source and ships breaking major releases. The package must track it; a Nova upgrade can silently strand you on an old package version. This is the single largest long-term risk and it is a support-matrix risk, not a code-quality risk.
  2. Write amplification on reorder. Sortable-style implementations typically renumber the surrounding set in a single transaction. On large, unscoped tables this means row locks and bulk writes on every drag — fine at hundreds of rows, painful at hundreds of thousands.
  3. Concurrency and correctness. Two admins dragging simultaneously, or a backfill running alongside edits, can produce duplicate or non-deterministic sort_order values. The package will not arbitrate this for you.
  4. Ecosystem validation. Zero Packagist dependents and a single-agency maintainer (Outl1ne) mean you are effectively trusting a small team's release cadence. The codebase is small and MIT-licensed, so forking is a viable escape hatch — but that is a cost you should price in, not assume away.

Key questions to resolve before committing.

  • Which Nova major version are we on, and is it in the package's supported matrix? Same for PHP and Laravel.
  • Is ordering global or scoped to a parent (e.g., items within a category)? If scoped, does the package support the parent key in its sort grouping?
  • How does ordering interact with Nova's pagination, search, and filters? Can an editor reorder across pages, or only within the visible page?
  • Does it conflict with existing orderBy calls, global scopes, or a default index sort in the resource?
  • What is the authorization story — can any Nova user reorder, or do we need a policy gate?
  • What is the backfill strategy for existing rows, and what deterministic order do we seed?

Integration Approach

Stack fit. Laravel + Nova + Composer. Requirements are a persisted integer column and a model trait; the Nova field is the UI. Fit is clean provided the application does not already own an ordering concern for the same model (e.g., an orderBy('position') baked into a repository or API contract). If it does, the package's column must either become the source of truth or be reconciled with it — decide this explicitly, because a second ordering authority is the most common way this integration goes wrong.

Migration path. Do the schema change online and additively:

  1. Add nullable sort_order (or your chosen column) with a composite index on (parent_key, sort_order) if ordering is scoped — this is the difference between a fast index scan and a filesort.
  2. Backfill deterministically in batches (e.g., by created_at, id) rather than leaving NULLs, so the initial ordering is stable and reproducible across environments.
  3. Add the trait and field behind a feature flag or environment check so the index view is unchanged until the data is ready.
  4. Publish and verify assets; confirm the JS bundle loads in staging, not just that the Composer install succeeded.

Compatibility. Pin the package version in composer.json alongside the Nova constraint, and treat Nova upgrades as a coupled change: bump Nova and this package in the same PR, with a smoke test that drag-and-drop actually persists. Do not let the package float on a ^ constraint against a closed-source dependency.

Sequencing. (1) Spike in a branch against a realistic dataset size to measure reorder latency and confirm scoping behaviour. (2) Schema migration and backfill, deployed without UI. (3) Trait + field behind a flag, enabled for internal admins first. (4) Enable broadly, with a documented "ordering owner" per resource. (5) Add the Nova-upgrade check to your recurring maintenance checklist. Total elapsed time is short; the sequencing exists to de-risk the data and the upgrade path, not the install.

Operational Impact

Maintenance. Ongoing cost is low but non-zero: periodic Composer updates, a compatibility check on every Nova upgrade, and monitoring of the upstream repo for abandonment. With a single-agency maintainer and no dependents, assign an internal owner and keep the fork option warm. The code footprint is small enough that a fork is hours, not weeks — but only if you have not patched it in place without tracking.

Support. Community-only: GitHub issues, no SLA, no vendor escalation. This is acceptable for an admin-only convenience feature and unacceptable if ordering becomes business-critical (e.g., customer-facing curation). Classify it accordingly before you build process around it.

Scaling. Reorder cost scales with the number of rows in the sort group, not the number of rows dragged. Keep sort groups small via parent scoping where the domain allows. On large flat tables, measure the reorder transaction time early and set a threshold above which the feature is disabled or re-architected (e.g., sparse ordering with gap-based positioning). The read path is cheap if the composite index exists; without it, every index view pays for a sort.

Failure modes to watch.

  • Duplicate or tied sort_order values after concurrent edits or a partial backfill, producing items that jump between pages.
  • Dragging within a filtered or searched view, which may not reflect the true global position — an intuitive-UX trap that generates support tickets.
  • Missing column or un-run migration causing a 500 on the index page.
  • Published assets stale after deploy, leaving drag handles visible but non-functional.
  • Nova upgrade breaking the field with no error until an editor tries to reorder.
  • Silent divergence from an existing application-level ordering contract.

Ramp-up. Developer ramp-up is negligible — an hour with the README. The real ramp-up is organisational: define who owns ordering per resource, document that ordering is per-page/per-scope, and decide whether ordering is advisory or contractual. That definition, not the code, is what determines whether this package stays a 285-star convenience or becomes an unowned dependency in your critical path.

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.
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
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator