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

Nova Sort Relations Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy: Sorting/filtering across Eloquent relationships is a recurring, cross-cutting concern. This package is a candidate to standardize that behavior instead of hand-rolling orderBy logic per endpoint.
  • Feature scoping: The new static sortableRelations method (with a default sort) lets you declare, in one place, which relations are sortable and what the fallback ordering is. That directly informs whether to expose relation-level sorting in admin panels, list APIs, and reporting views.
  • API/contract clarity: A declarative allowlist of sortable relations plus an explicit default makes sortable surface area reviewable, which supports decisions about what to expose publicly vs. keep internal.
  • Roadmap risk: This is a v0.0.x release (v0.0.2). Treat adoption as exploratory/pilot; budget for upgrade churn and avoid coupling it to irreversible product commitments.
  • Use cases: Admin dashboards, paginated list endpoints that sort by joined/related columns, and internal reporting screens where consistent default ordering matters.

When to Consider This Package

  • You have multiple list endpoints or admin screens that need sorting by related model columns, and you want a single allowlist + default rather than duplicated query logic.
  • You want a safer alternative to raw, user-driven orderBy (whitelisted sortable relations reduce injection/abuse surface).
  • You are comfortable pinning a pre-1.0 dependency and wrapping it behind an internal adapter/service.
  • Look elsewhere / build in-house if: you need long-term API stability, vendor support, or SLAs; your sorting needs are trivial (a single orderBy suffices); you require advanced multi-column/relation sorting semantics not covered by this package; or you cannot absorb breaking changes on minor version bumps.
  • Immediate diligence: confirm the exact signature/default semantics of sortableRelations (how defaults interact with request input and multi-relation sorting), test coverage, and whether it validates unknown relations.

How to Pitch It (Stakeholders)

  • For executives: A small, focused dependency that standardizes how sorting works across admin and API surfaces, reducing bespoke query code and its maintenance cost. Early-stage (v0.0.2), so we recommend a limited pilot rather than broad rollout.
  • For engineering: The v0.0.2 addition of a static sortableRelations method with a default centralizes the sortable-relation allowlist and fallback ordering, cutting per-endpoint boilerplate and making ordering behavior explicit and testable. Because it is pre-1.0, we should pin the version, keep usage behind a thin adapter, and review changelogs before upgrades.
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.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels