From: Vincent Vanwaelscappel Date: Fri, 3 Apr 2020 11:58:58 +0000 (+0200) Subject: wip #3546 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=5ac41f56a3b7d2853a3de4e0d5bf69a80cfd10a8;p=cubist_cms-back.git wip #3546 @2 --- 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; + } +}