Add-ons

Reorder

About

Requirements

Your model should have the following integer fields, with a default value of 0: parent_id, lft, rgt, depth.

Additionnaly, the parent_id field has to be nullable.

How to Use

The Reorder operation is disabled by default. To enable it, you should use $this->crud->allowAccess('reorder'); inside your setup() method. This will make a Reorder button appear in ListEntries, in the top button stack. Then, in your EntityCrudController's setup() method:

$this->crud->enableReorder('attribute_name', ALLOWED_DEPTH);

Where:

attribute_name should be the attribute you want shown on the draggable elements (ex: name);

ALLOWED_DEPTH should be an integer, how many levels deep would you allow your admin to go when nesting; for infinit levels, you should set it to 0;

How It Works

The /reorder route points to a reorder() method in your EntityCrudController.

Help & Support

Community

Company

Login for the full experience

If you decide to use Backpack in your projects, please create an account. You'll get ultra-fast search in documentation, important security updates, monthly newsletter - all free, after you click one button. Plus, you'll never see this pop-up again.