This package adds drag-and-drop reordering and resizable index columns to Laravel Nova resources. The 1.1.0 release is a maintenance/UX release: a larger resizable drag hit-area, a fix for Nova 3.29+, and routine dependency bumps. There are no breaking changes, so upgrading from 1.0.x is a composer update.
Minimal setup:
composer require the package (follow the README's version constraint — 1.1.0 assumes Nova 3.29 or later).php artisan vendor:publish --provider="...ServiceProvider" then php artisan migrate. The migration typically adds the sort column (default sort_order) and, for resizable, nothing at all — widths are a frontend concern.resizable() on the index fields) and make sure the index query orders by the sort column.First use case: open a Nova index view, drag a row by its handle, reload the page and confirm the new order persists. If that works, the wiring (trait + resource + migration) is correct; everything else is configuration.
Where to look first: the published config (sort column name, grouping/scope behavior), the trait source for the creating hook that assigns the initial sort value, and the resource's indexQuery — the most common cause of "sorting doesn't work" is a missing orderBy.
Scoped sorting. Most real usage is not a single global list. If you have parent_id, category_id, or a tenant column, configure the package's grouping/scope so sort_order restarts per group. Otherwise moving an item in one category shifts siblings in another.
Appending new records. The trait normally assigns max(sort_order) + 1 on creating. If you create records in bulk (seeders, imports, API batches), either assign sort_order explicitly or insert sequentially — a batch insert bypasses model events and leaves everything at 0/NULL.
Backfilling existing data. After adding the column, backfill before enabling the UI: order by id (or your natural order) within each group and write incrementing values. Doing this in a migration keeps environments consistent.
Resizable columns. Column widths are a per-browser/per-user convenience, not a data feature. Pair them with the resource's default column set so the first load is sensible; don't try to persist widths server-side unless the package exposes that. Expect the widened hit-area from 1.1.0 to make dragging easier on narrow columns.
Ordering in queries. Always mirror the UI order in indexQuery, e.g. ->orderBy('sort_order'), and include the same grouping column. Watch lenses, filters, and relation-manager indexes — each has its own query and needs the same treatment.
Testing. Model factories are the seam: assert that a created model receives the next sort value, and that a reorder operation produces a contiguous 1..n sequence per group. Contiguity matters if you ever compute "move up/down" arithmetic.
sort_order. If your own code does sort_order - 1 / + 1 swaps, gaps and duplicates will eventually break it; prefer a full reindex of the group on each move.NULL vs 0. Make the column non-nullable with a default, and backfill before shipping, or records with NULL will sort inconsistently across databases.orderBy is the #1 bug report. The drag handle saves a value but the table looks unchanged until you add ordering to indexQuery — and to any custom index/lens you use.max() + 1 per create is fine to tens of thousands of rows; full-group reindexing on every move is O(n) writes. If lists get large, consider fractional/sparse ordering.How can I help you explore Laravel packages today?