From a9735391862eea6b319657df1c694fa360f7561c Mon Sep 17 00:00:00 2001 From: pxpm Date: Tue, 24 Sep 2024 14:37:05 +0100 Subject: [PATCH] allow customizing reorder column names --- 6.x/crud-operation-reorder.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/6.x/crud-operation-reorder.md b/6.x/crud-operation-reorder.md index 5cd6ac55..a0eab207 100644 --- a/6.x/crud-operation-reorder.md +++ b/6.x/crud-operation-reorder.md @@ -12,7 +12,20 @@ This operation allows your admins to reorder & nest entries. ## Requirements -Your model should have the following integer fields, with a default value of 0: ```parent_id```, ```lft```, ```rgt```, ```depth```. +Your model should have the following integer fields, with a default value of 0: ```parent_id```, ```lft```, ```rgt```, ```depth```. The names are optional, you can change them in the ```setupReorderOperation()``` method. + +```php + +protected function setupReorderOperation() +{ + CRUD::setOperationSetting('reorderColumnNames', [ + 'parent_id' => 'custom_parent_id', + 'lft' => 'left', + 'rgt' => 'right', + 'depth' => 'deep', + ]); +} +``` Additionally, the `parent_id` field has to be nullable.