baril/orderly
Add sortable, orderable behavior to Laravel Eloquent models. Store a position column (default: position), use the Orderable trait, and move records with helpers like moveToOffset() and moveToStart(). Supports Laravel 6–12 with version mapping.
UPDATE cascades, gap handling) into a reusable trait. Aligns with:
sort_order columns).section_id grouping).Post::tags()->ordered()).saveOrder() (avoids N+1 query pitfalls).delete and position assignment on create.GroupException in relationships).observers or events.For Executives: "This package lets us ship sortable UIs (e.g., drag-and-drop menus, playlists) 3x faster by handling the heavy lifting of database ordering automatically. It’s like adding a ‘sort’ superpower to our Eloquent models—no more manual SQL updates or race conditions. Supports all our databases (MySQL, PostgreSQL) and plays well with our existing Laravel codebase. The trade-off? Minimal upfront cost (2 hours to integrate) vs. weeks of custom dev work. ROI: Faster feature delivery for CMS/e-commerce tools."
For Engineers: *"Orderly gives us a batteries-included solution for Eloquent ordering with:
use Orderable to your Article or Post model.saveOrder() handles mass updates efficiently (no N+1 queries).section_id).php artisan orderly:fix-positions cleans up gaps after manual deletes.
Downside: Small community (but active maintainer). We’d need to test edge cases (e.g., concurrent edits) in our staging environment. Alternative is writing custom SQL, but this saves ~10–15 hours of dev time per feature."*How can I help you explore Laravel packages today?