lifeonscreen/nova-sort-relations
A Laravel Nova package for sorting related models. It adds drag-and-drop reordering of hasMany and belongsToMany relationships directly on resource detail pages, saving sort order automatically. Ideal for managing ordered lists like menu items, gallery images, or featured posts without custom code.
Architecture fit
The package occupies the model-layer slot of a Laravel application: it augments Eloquent models with configurable sorting/ordering behavior over relations. That is a natural fit for a Laravel/PHP codebase and does not require new infrastructure, service providers outside the standard package auto-discovery path, or changes to the request lifecycle. The v0.0.2 addition of a static sortableRelations method with a default reinforces this model-centric design: sortable relation sets are declared on the model (or fall back to a package default) rather than being wired per-call-site. Architecturally this is the right direction for a package at this maturity — it centralizes a cross-cutting concern that would otherwise be duplicated in controllers or query scopes.
Integration feasibility Additive and low-friction. A new static method cannot break existing call sites, and the "with default" behavior means consumers who do not declare anything on their models still get a working baseline. Integration cost is therefore near zero for greenfield adoption and a single small change for existing models that want to opt into an explicit relation list. The main feasibility constraint is not effort but discovery: because the method is static and defaulted, behaviour can be inherited implicitly, which makes the effective sortable surface of an application non-obvious from reading a model.
Technical risk
sortableRelations. This is the dominant risk and should be treated as a pinning requirement, not a footnote.Key questions
Stack fit Standard Laravel package: Composer-installed, auto-discovered service provider, no additional runtime services, no queue or cache dependency introduced by this release. It fits any Laravel version the package declares support for; the static method uses no framework primitives that would narrow that matrix. No conflict with existing application architecture is expected.
Migration path
There is nothing to migrate. v0.0.2 is additive over v0.0.1. For existing models, adoption is optional and incremental: leave the package default in place to ship faster, or declare an explicit sortableRelations list per model to make the allowed surface auditable. Recommendation: declare explicitly on any model that receives sorting input from a request, and rely on the default only for internal/admin surfaces.
Compatibility
Backward compatible at the API level. Two compatibility notes for the record: (a) pin to 0.0.2 exactly or with a tight constraint, given pre-1.0 semver; (b) verify the package's PHP and Laravel version constraints against the target application before adopting, since the release note does not state whether the support matrix changed.
Sequencing
sortableRelations declaration — to confirm precedence semantics.Maintenance Low ongoing maintenance for the application team; moderate dependency-management attention. The package is at v0.0.x with a single-maintainer risk profile typical of early-stage packages. Budget for a review of every release until 1.0 rather than assuming patch-level safety, and track the changelog as a standing item.
Support Internal support burden is minimal because the feature is declarative and has a default. The realistic support tickets are "why can't I sort by X" (default did not include it) and "why is this query slow" (a relation was sortable but unindexed). Both are answered by documentation of the effective sortable set per model — worth generating that list as a one-off audit artifact rather than relying on tribal knowledge.
Scaling The package adds no infrastructure, so horizontal scaling is unaffected. The scaling concern is query-level: sorting by a relation can require a join or a subquery, and on large tables an unindexed sort column degrades non-linearly. The defaulted static method makes this easier to trigger accidentally, because sortable relations may be enabled without anyone reviewing index coverage. Recommend an index review for every relation that becomes sortable in a high-volume path, and load-test the ordering endpoint against production-shaped data before exposing it broadly.
Failure modes
sortableRelations and the default also applies, producing a union the author did not expect. Verify empirically in step 2 of the sequencing.Ramp-up Very low for a Laravel-competent engineer: one method, declarative usage, no new concepts. Estimate well under a day to first working integration and roughly a day to cover the audit, test-state reset, and index review. The real ramp-up cost is organizational — establishing the discipline to declare sortable relations explicitly rather than accepting the default, which is a convention decision to make once and document.
How can I help you explore Laravel packages today?