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

Technical Evaluation

Architecture fit: The package uses a non-invasive trait-based approach that integrates seamlessly with Laravel's Eloquent ORM. It leverages standard Laravel patterns (query scopes, events, config files) without requiring architectural changes. The grouping functionality via buildSortQuery provides clean separation for multi-tenant or context-specific sorting.

Integration feasibility: Very high. Installation is trivial via Composer. Implementation requires only adding the trait and interface to models, with minimal configuration. The documentation provides clear examples for all core features and edge cases (e.g., custom order columns, grouping).

Technical risk: Moderate. Latest version (5.0.0+) requires PHP 8.2+ and Laravel 10+, which may conflict with legacy projects. Performance could degrade with very large datasets (>10k records) due to individual row updates during reordering. No built-in transaction handling for concurrent sort operations, risking order inconsistencies during high-write scenarios.

Key questions: What are the current Laravel/PHP versions in production? How many sortable records exist per group? Are there existing concurrent write patterns that might cause race conditions? How critical is real-time sorting consistency for business

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport