Weave 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
Sortable Behavior Bundle

Sortable Behavior Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

mysam/sortable-behavior-bundle adds sortable behavior to Doctrine entities in Symfony applications. Attach the behavior to an entity and it maintains a position column automatically, so records can be reordered by hand or from a drag-and-drop UI and persisted in the right sequence.

  • Automatic position management on insert, update and delete
  • Configurable position field and sort scope per entity
  • Reordering API for moving items up, down, or to an index
  • Plugs into existing Doctrine mappings and repositories
Frequently asked questions about Sortable Behavior Bundle
Is mysam/sortable-behavior-bundle compatible with Laravel?
No. It is a Symfony bundle built around the Symfony kernel, DI extensions, Doctrine and Sonata Admin, and it ships no service provider, facade, Eloquent trait or Blade/Inertia UI. For Laravel you should use spatie/eloquent-sortable or a small in-house position trait instead.
How do I install pixSortableBehaviorBundle in a Symfony project?
Require the package with Composer, register the bundle in config/bundles.php (or AppKernel on older Symfony), and enable the Gedmo/Stof Sortable extension with a position column on your entity. You then configure the Sonata Admin sortable field so the up, down and top controls appear. Expect to pin Symfony, Doctrine and Sonata versions that match the package's 2020-era constraints.
What does this bundle actually do?
It adds sortable behavior to Doctrine models by persisting an integer position column and exposing move up, move down and move to top actions in Sonata Admin listings. The underlying sorting logic comes from the Gedmo/Stof Sortable extension, and the bundle wires it into the admin UI. It is not a general-purpose PHP reordering library.
Which Symfony, Sonata Admin and Doctrine versions does it support?
The last release is dated 2020-10-16, so it targets Symfony 4/5-era wiring, Sonata Admin 3/4 and Doctrine ORM 2.x with stof/doctrine-extensions-bundle. It predates PHP 8.1, 8.2, 8.3, Doctrine 3 and Sonata Admin 5, so Composer constraint conflicts are likely. Check the bundle's composer.json before planning any upgrade.
Is there a maintained alternative to this fork?
Yes. Use the canonical upstream Pix pixSortableBehaviorBundle first, since this Software-For-Asset-Management copy has 0 stars, no visible issue triage and no CI signals. For Symfony without Sonata, the Gedmo/Stof Sortable extension alone covers most needs. For Laravel, spatie/eloquent-sortable is the actively maintained, Eloquent-native choice.
Does it provide drag-and-drop reordering in the admin panel?
It provides server-rendered move up, move down and move to top controls inside Sonata Admin listings, not a drag-and-drop widget. Real drag-and-drop needs custom JavaScript calling an endpoint, and this bundle ships nothing for Blade, Inertia or a headless API. If you need drag-and-drop within filtered or paginated subsets, you will write that layer yourself.
Can I use this package with Eloquent models?
No. The behavior is tied to Doctrine ORM entities and the Gedmo Sortable extension, with no Eloquent trait or query builder integration. Laravel has no bundle or compiler-pass lifecycle, so the package's service registration and admin controllers cannot be reused. Porting it is a rewrite, not an integration.
Is this package safe and maintained for production use?
Treat it as unmaintained: last release in 2020, a single maintainer, 0 stars, 0 dependents and no security policy or CVE feed. It runs inside an authenticated, high-privilege admin panel, which raises the cost of an unpatched issue. If you adopt it, fork it, vendor it and assign a permanent owner for patches.
How would I implement sortable records in Laravel without this bundle?
Add a nullable, indexed integer position column plus a composite index on the scope columns such as position and category_id or tenant_id. Encapsulate reordering behind a small service with moveTo, moveBefore and moveAfter, using a transaction and SELECT FOR UPDATE on the affected scope before renumbering the window. Expose a single PATCH endpoint that accepts the new index, debounce drag events in the UI, or simply install spatie/eloquent-sortable.
Why does Composer fail to install this package on PHP 8.2?
Conflicts usually come from the package's 2020-era constraints on PHP, symfony/*, doctrine/orm and sonata-admin, which exclude PHP 8.1+, Doctrine 3 and Sonata Admin 5. Its dependencies on stof/doctrine-extensions-bundle and the Gedmo Sortable extension must also resolve against your pinned versions. Run composer why-not to identify the blocking constraint, and be prepared to fork and relax it.
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.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect