Skip to content

[Propose] [WIP] - SimpleReorderOperation, when you need a simple way to order items - #5766

Open
susanu wants to merge 2 commits into
Laravel-Backpack:mainfrom
susanu:patch-14
Open

susanu wants to merge 2 commits into
Laravel-Backpack:mainfrom
susanu:patch-14

Conversation

@susanu

@susanu susanu commented Jan 31, 2025

Copy link
Copy Markdown
Contributor

WHY

I have some items that need to be sorted in a specific way, this is controlled by a single column in the database called order.
I tried the classic ReorderOperation but it works only with multiple columns.
I just want a dumb, simple ordering, no levels, no trees.

Works similar to ReorderOperation, have the same configuration with a small change.
NOTE: Use either ReorderOperation or SimpleReorderOperation

Example:

protected function setupReorderOperation(): void
{
    CRUD::set('reorder.label', 'product.name');
    CRUD::set('reorder.column', 'order');
}

What is different:
Removed following settings:

  • max_level
  • reorderColumnNames

Added following settings:

  • column -> the db column that is used to sort the items

Let me know your thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status
Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants