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

Nova Sortable Laravel Package

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.

View on GitHub
Deep Wiki
Context7

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag & drop.

Frequently asked questions about Nova Sortable
How do I install outl1ne/nova-sortable?
Install it with composer require outl1ne/nova-sortable in a Laravel project running Nova 5. Then add a sort_order integer column to the model's table, backfill it, implement Spatie's Sortable interface and SortableTrait on the model, and apply the HasSortableRows trait to the Nova resource. The package is Composer-only and does not require frontend build changes.
Does nova-sortable support Laravel Nova 4?
No. The package requires laravel/nova ^5.0 and PHP >=8.1, so Nova 4 is a hard blocker until you upgrade. Treat Nova 5 as a prerequisite rather than a side effect of installing this package. If your organization still has resources on Nova 4, those resources cannot use this package yet.
How do I add drag-and-drop reordering to a Nova resource?
Add an integer sort_order column via migration and backfill it deterministically, for example by copying the id. Implement Spatie\EloquentSortable\Sortable and use SortableTrait on the model, then add the Outl1ne\NovaSortable\Traits\HasSortableRows trait to the Nova resource. Note that HasSortableRows overrides the resource's indexQuery() method, so review any custom index query logic.
Does nova-sortable work with HasMany and pivot/many-to-many relationships?
Yes. The package supports drag-and-drop reordering on the Nova index view and on HasMany views, and it includes BelongsTo/MorphsTo reorder support with pivot tables. For many-to-many ordering you will need a sort_order column on the pivot table and a clearly defined sortable scope. That means a second migration and careful scope configuration, but no custom reordering code.
What migration and backfill do I need for sort_order?
Add a nullable or integer sort_order column to the table, then backfill it deterministically with a statement such as UPDATE some_model SET sort_order = id. After backfilling, enforce non-null and consider a composite index on the scope column plus sort_order. A nullable or non-backfilled column produces non-deterministic ordering and phantom bugs in the Nova UI.
How do I disable sorting for a specific resource or request?
Override the static canSort(NovaRequest $request, $resource) method on the Nova resource to return false for the cases you want to block. The package documents this as the per-request and per-resource way to disable sorting. This is useful when only some resources or user roles should be allowed to reorder rows.
What happens if sort_order is null or not backfilled?
A null or non-backfilled sort_order column leads to non-deterministic ordering, which often appears as rows jumping around or phantom bugs in the admin UI. The package relies on Spatie eloquent-sortable's ordering values, so every row in a sortable set needs a valid position. Backfill before enabling drag-and-drop, and enforce non-null once the data is correct.
How does nova-sortable handle concurrent reordering by multiple admins?
Drag-and-drop reordering writes position values without optimistic locking, so two admins reordering the same list at the same time can produce inconsistent sequences. The risk is low frequency but real in busy admin panels. If that matters, limit reordering to a small set of users or add process controls around bulk reordering.
Does nova-sortable require spatie/eloquent-sortable and can I customize the sortable config?
Yes. It is a thin Nova wrapper over spatie/eloquent-sortable, so the model uses Spatie's Sortable interface and trait. You can set the order_column_name and sort_when_creating options in the model's $sortable array; if you do not configure them, eloquent-sortable's defaults apply. Check that the pinned eloquent-sortable major is compatible with your Laravel version before committing.
Is outl1ne/nova-sortable actively maintained and what should I consider before adopting it?
It is a single-vendor package from outl1ne with an MIT license, roughly 285 GitHub stars, and no SLA, so bus factor is a consideration. Recent releases and changelog activity are positive signals, and the zero dependents figure is likely an artifact of Nova's closed ecosystem rather than zero adoption. If you are not on Nova 5, evaluate Spatie eloquent-sortable directly with a custom Nova field or tool instead.
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.
alphabalex/messaging-made-easy
rawphp/warp
shootkiran/merobug
narakode/fineauth
numencode/wn-syncops-plugin
ibnnajjaar/mib-global-pay
ably/pubsub-server
mstfkhazaal/defender
mfonte/base62x
karnoweb/metapilot
tobya/bcsapiwrapper
swalker2/cpanel
vish4395/laravel-translation-manager
morningtrain/economic
teksite/systeminfo-laravel
atomcms/voting
run6/weather
siokas/laravelembeddirectives
adamlien/pkuuids
gilsonsouza/lara-doc-generator