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

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

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 optimistdigital/nova-sortable in a Laravel Nova application?
Install it with composer require optimistdigital/nova-sortable, then publish the package assets so the drag-and-drop JavaScript loads in Nova. Add a nullable integer sort_order column to the model's table, apply the package trait to the model, and add the sortable field to the Nova resource's fields() method. Finally, verify the assets load in staging and that the index view shows drag handles.
Which Laravel and Nova versions does nova-sortable support?
Check the package's Composer constraints and Packagist metadata against your exact Laravel, PHP, and Nova major versions before committing. Nova is closed-source and ships breaking major releases, so the package's supported matrix can lag behind a new Nova upgrade. Pin versions and test the Nova upgrade path rather than assuming compatibility.
What schema and model changes are needed to make a Nova resource sortable?
You need a persisted integer column such as sort_order, usually nullable during rollout, plus the package trait on the Eloquent model. Then add the sortable field to the Nova resource's fields() method so the index table renders drag handles. If ordering is scoped to a parent record, add a composite index such as parent_key plus sort_order to keep reads efficient.
Does nova-sortable support scoped sorting, such as items within a category?
Scoped ordering is one of the key fit questions to resolve before committing. If your ordering is scoped to a parent, confirm that the package version you are installing supports the parent key in its sort grouping. Plan the index around parent_key plus sort_order so scoped queries avoid filesorts.
Can editors reorder records across pagination pages in Nova?
Drag-and-drop sorting normally works within the visible index page, so reordering across paginated pages is not a safe assumption. Test how the package behaves with Nova pagination, search, and filters before exposing it to editors. If cross-page ordering matters, you may need a different UI or a workflow that moves records page by page.
How should I backfill sort_order for existing rows before enabling nova-sortable?
Backfill deterministically in batches, for example by created_at and id, rather than leaving NULL values that produce unstable initial ordering. Do the schema change additively and add any needed composite index at the same time. Consider adding the trait and field behind a feature flag so the Nova index stays unchanged until the backfill is complete.
Is nova-sortable safe for large tables with hundreds of thousands of rows?
Sortable implementations typically renumber the surrounding set in a transaction, which means row locks and bulk writes on every drag. That is usually fine at hundreds of rows but can become painful at hundreds of thousands, especially on large unscoped tables. Add appropriate indexes, scope ordering where possible, and test reorder performance against realistic data volumes.
How do I restrict which Nova users can reorder records?
Do not assume there is a dedicated reorder permission; the field controls UI visibility, not a separate authorization gate. Use Nova resource authorization or conditional field visibility to hide the sortable field from users who should not reorder. If you need finer control, add a policy check around the resource or a custom gate before exposing the drag handles.
Does nova-sortable conflict with existing orderBy calls or a default index sort in the resource?
It can conflict if your resource, global scopes, or repository already applies a different default ordering. The package persists sort_order, but your Nova index must actually order by that column for the drag order to appear correctly. Decide explicitly whether the package's column becomes the single source of truth or must be reconciled with an existing ordering authority.
Is optimistdigital/nova-sortable well maintained, and what are the alternatives?
The package is maintained by Outl1ne, a single agency, and has a small MIT-licensed codebase with limited ecosystem dependents. That makes forking a viable escape hatch, but you should price in maintenance and upgrade work rather than assume it away. Monitor release cadence and Nova compatibility, and evaluate a fork or in-house field if the support matrix stops tracking your Nova version.
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.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route