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.
codraw/entity-migrator
codraw/doctrine-extra
codraw/aws-tool-kit
codraw/validator
codraw/workflow
codraw/open-api
codraw/cron-job
codraw/process
codraw/log
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony