From 651b2e02d72df6f0d27ca0cb3b70d76068a81632 Mon Sep 17 00:00:00 2001 From: Karan Datwani Date: Wed, 28 Jun 2023 20:25:45 +0530 Subject: [PATCH] init --- 6.x/crud-columns.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/6.x/crud-columns.md b/6.x/crud-columns.md index d2dbb1c7..49699238 100644 --- a/6.x/crud-columns.md +++ b/6.x/crud-columns.md @@ -177,7 +177,27 @@ The checklist column will output its connected entity. Used for relationships li ### checklist_dependency -// TODO +Show connected items selected via checklist_dependency field. It's definition is totally similar to the [checklist_dependency *field type*](/docs/{{version}}/crud-fields#checklist_dependency). + +```php +[ + 'label' => 'User Role Permissions', + 'type' => 'checklist_dependency', + 'name' => 'roles,permissions', + 'subfields' => [ + 'primary' => [ + 'name' => 'roles', // the method that defines the relationship in your Model + 'entity' => 'roles', // the method that defines the relationship in your Model + 'attribute' => 'name', // foreign key attribute that is shown to user + ], + 'secondary' => [ + 'name' => 'permissions', // the method that defines the relationship in your Model + 'entity' => 'permissions', // the method that defines the relationship in your Model + 'attribute' => 'name', // foreign key attribute that is shown to user + ], + ], +] +```