Weave Code
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

Eloquent Sortable Laravel Package

spatie/eloquent-sortable

Add sortable behavior to Laravel Eloquent models via a trait. Automatically sets an order column on create (max + 1) and provides a scope to retrieve records in the correct order. Ideal for drag-and-drop lists and custom ordering.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enables drag-and-drop reordering in admin interfaces (e.g., CMS content, task boards) without custom SQL or manual order management
  • Supports user-configurable sorting in front-end applications (e.g., personalized lists, product rankings) by automating order column maintenance
  • Accelerates roadmap delivery for order-dependent features by replacing error-prone custom implementations with a battle-tested solution
  • Critical for features requiring sequence integrity (e.g., FAQ sections, navigation menus, e-commerce product hierarchies) with minimal engineering effort

When to Consider This Package

  • ✅ Adopt when: building Laravel/Eloquent applications needing sortable behavior; requiring per-group sorting (e.g., by user_id or category); needing events for post-sort actions (e.g., cache invalidation); or requiring precise positioning (e.g., moveBefore/moveAfter)
  • ❌ Avoid when: project uses non-Eloquent ORM; sorting needs are trivial (e.g., always order by ID); custom multi-column/hierarchical sorting is required; or legacy Laravel/PHP versions are in use (min Laravel 10, PHP 8.2)

How to Pitch It (Stakeholders)

Executives: "This package eliminates 20+ hours of development time for sorting features by providing a proven, maintainable solution. It reduces bug risk in critical user-facing ordering functionality (e.g., drag-and-drop reordering) while supporting enterprise-grade requirements like grouping and event-driven workflows. With 1,500+ stars and active maintenance, it's a low-risk investment that accelerates time-to-market for high-value features."
Engineering: "Integration takes minutes: just add the trait and configure. Handles edge cases like grouping, bulk reordering, and event dispatching out-of-the-box. Avoids reinventing sorting logic and benefits from Spatie's rigorous testing and Laravel ecosystem expertise. Recent updates ensure compatibility with Laravel 13 and modern PHP standards."

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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai