mysam/sortable-behavior-bundle
A Symfony bundle that adds sortable behavior to Doctrine entities, making it easy to order records with position fields and reorder them in admin lists and other collections.
Headline risk: this is not a Laravel package. The name and repo (pixSortableBehaviorBundle) identify it as a Symfony bundle, not a Composer library with Laravel support. It is designed to plug into the Symfony kernel as a bundle, register services through a DI Extension class, and integrate with Sonata Admin and Doctrine (via the Gedmo/Stof Sortable extension) to render up/down/move-to-top controls and persist an integer position column. None of that lifecycle exists in Laravel (Eloquent models, service providers, no bundle/compiler-pass model, no Sonata Admin).
Architecture fit
Integration feasibility
position-based reorder capability yourself (small), with none of the package's code reusable.Technical risk — high
pixSortableBehaviorBundle; the canonical upstream exists and is more used. The copy under Software-For-Asset-Management has no visible community, no issue triage, no CI signals in the metadata provided.Key questions
position column already in place?stof/doctrine-extensions-bundle are pinned, and does the bundle's composer.json allow them?Stack fit
spatie/eloquent-sortable (actively maintained, Eloquent-native, trait-based, handles scoped sorting groups) or a ~150-line in-house trait.Migration path (Laravel)
position column (nullable, indexed) with a composite index on the scope columns (position, plus any parent/group key such as category_id or tenant_id).moveTo(int $id, int $position) and moveBefore/moveAfter — so the storage strategy is swappable.SELECT ... FOR UPDATE on the affected scope, then renumber the affected window.PATCH /resource/{id}/position) plus a UI that sends {id, newIndex}; debounce drag events.Consider fractional/lexicographic ranking (position as a decimal or sortable string) as an alternative: single-row writes instead of O(n) renumbering, at the cost of rebalancing jobs.
Compatibility
composer.json: PHP constraint, symfony/* constraints, Doctrine ORM version, Sonata Admin version, and whether it requires gedmo/doctrine-extensions directly or through stof/doctrine-extensions-bundle.symfony/* to older minors or to patch constraints to run on PHP 8.2+. Do not assume --ignore-platform-reqs is acceptable in production.Sequencing
position in a backfill job, then enable.Maintenance
spatie/eloquent-sortable shifts that burden to a maintained vendor — the correct trade.Support
composer.json by VCS path, and a SECURITY.md-style expectation of prompt patching for admin-surface code.Scaling
UPDATEs). Fine to a few thousand rows per scope; problematic for large or hot scopes.SELECT-then-UPDATE loops causing N+1 queries and long transactions; a single drag on a 5k-row list can hold locks long enough to cause visible latency.Failure modes
(position, id) as a tiebreaker.Ramp-up
position integer plus move operations every engineer already understands — low cognitive load, no training needed.Recommendation: do not adopt as a dependency. For a Laravel target, use spatie/eloquent-sortable or a small in-house trait behind a single reorder interface; for a Symfony/Sonata target, evaluate the canonical upstream Pix bundle and vendor it with a named owner.
How can I help you explore Laravel packages today?