From 5ac41f56a3b7d2853a3de4e0d5bf69a80cfd10a8 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 3 Apr 2020 13:58:58 +0200 Subject: [PATCH] wip #3546 @2 --- src/app/Magic/Fields/RolesPermissions.php | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/app/Magic/Fields/RolesPermissions.php diff --git a/src/app/Magic/Fields/RolesPermissions.php b/src/app/Magic/Fields/RolesPermissions.php new file mode 100644 index 0000000..5600d15 --- /dev/null +++ b/src/app/Magic/Fields/RolesPermissions.php @@ -0,0 +1,39 @@ + [ + 'label' => trans('backpack::permissionmanager.roles'), + 'name' => 'roles', // the method that defines the relationship in your Model + 'entity' => 'roles', // the method that defines the relationship in your Model + 'entity_secondary' => 'permissions', // the method that defines the relationship in your Model + 'attribute' => 'name', // foreign key attribute that is shown to user + 'model' => config('permission.models.role'), // foreign key model + 'pivot' => true, // on create&update, do you need to add/delete pivot table entries?] + 'number_columns' => 3, //can be 1,2,3,4,6 + ], + 'secondary' => [ + 'label' => ucfirst(trans('backpack::permissionmanager.permission_singular')), + 'name' => 'permissions', // the method that defines the relationship in your Model + 'entity' => 'permissions', // the method that defines the relationship in your Model + 'entity_primary' => 'roles', // the method that defines the relationship in your Model + 'attribute' => 'name', // foreign key attribute that is shown to user + 'model' => config('permission.models.permission'), // foreign key model + 'pivot' => true, // on create&update, do you need to add/delete pivot table entries?] + 'number_columns' => 3, //can be 1,2,3,4,6 + ], + ]; + return $res; + } +} -- 2.39.5