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

Orderable Laravel Package

zigastrgar/orderable

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Dynamic Sorting Flexibility: Enables product teams to implement granular, runtime-adjustable sorting logic (e.g., A/B testing sort orders, user-preference-driven UI, or algorithmic prioritization) without hardcoding in controllers/models. Reduces frontend-backend coupling for sorting use cases.
  • Roadmap for "Smart Defaults": Supports future features like:
    • User-Specific Sorting: Tie sort rules to authenticated users (e.g., "show my recent interactions first").
    • Context-Aware Sorting: Apply rules based on request context (e.g., "sort by trending in mobile view, by recency in desktop").
    • Collaborative Filtering: Combine package’s rule-sets with recommendation algorithms (e.g., "sort by popularity and user similarity score").
  • Build vs. Buy: Avoids reinventing sorting middleware/validation logic. Justifies using this over custom solutions for teams already invested in Laravel’s Eloquent.
  • Use Cases:
    • E-commerce: Dynamic product listings (e.g., "sort by price asc/desc unless user is VIP, then sort by personalization score").
    • SaaS Dashboards: User-configurable widget ordering (e.g., "drag-and-drop UI → saved as a rule-set").
    • Content Platforms: Editorial vs. algorithmic sort overrides (e.g., "promote trending except for paid posts").

When to Consider This Package

  • Adopt if:
    • Your Laravel app requires runtime-modifiable sorting beyond static orderBy() clauses (e.g., user preferences, AB tests, or dynamic business rules).
    • You need to compose complex sort logic (e.g., "sort by X unless condition Y is true, then sort by Z").
    • Your team wants to decouple sorting logic from controllers/models to reduce technical debt (e.g., move rules to a config/database layer).
    • You’re using Eloquent and want to avoid raw SQL for maintainability.
  • Look elsewhere if:
    • Your sorting needs are static (e.g., ORDER BY created_at DESC everywhere). Use Eloquent’s built-in methods instead.
    • You’re not using Laravel/Eloquent. This package is Laravel-specific.
    • You need client-side sorting (e.g., JavaScript-based UI). Pair with a frontend library like SortableJS.
    • Your use case involves non-tabular data (e.g., graphs, geospatial). Consider specialized packages like spatie/laravel-geocoder.

How to Pitch It (Stakeholders)

For Executives: "This package lets us ship dynamic sorting features—like user-customizable dashboards or A/B-tested product listings—without adding backend complexity. For example, we could let power users reorder their dashboard widgets, and the changes persist via saved sort rules. It’s a low-code way to add stickiness to our product without heavy dev work. The v1.1 update lets us fine-tune sorting logic further, like excluding certain fields from default orders."

For Engineering: *"This is a lightweight abstraction for Eloquent sorting that supports:

  • Rule composition: Chain or exclude sort clauses at runtime (e.g., applyRules(['price', 'rating'])->removeRule('created_at')).
  • Config-driven: Move sort logic out of controllers into config/database for easier maintenance.
  • No performance overhead: Uses Eloquent’s native query builder under the hood. Use case: If we’re building a ‘save my view’ feature for the admin panel, this handles the sorting persistence cleanly. For new projects, it’s a drop-in replacement for manual orderBy() logic."*
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.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle