File tree 1 file changed +6
-9
lines changed
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -44,20 +44,17 @@ public function edit($name) : View
44
44
{
45
45
$ role = (new Role )->with ('permissions ' )->find ($ name );
46
46
$ this ->authorize ('edit ' , $ role );
47
- $ actions = (new Action )->all ();
48
- $ entities = collect (array_keys (app ('Illuminate\Contracts\Auth\Access\Gate ' )->policies ()))
49
- ->map (function ($ entity ) {
50
- return strtolower (collect (explode ('\\' , $ entity ))->last ());
51
- })
52
- ->filter (function ($ entity ) {
53
- return ! in_array ($ entity , ['permission ' , 'entity ' ]);
54
- })
55
- ->map (function ($ entity ) {
47
+ collect (array_keys (app ('Illuminate\Contracts\Auth\Access\Gate ' )->policies ()))
48
+ ->each (function ($ entity ) {
49
+ $ entity = strtolower (collect (explode ('\\' , $ entity ))->last ());
50
+
56
51
return (new Entity )
57
52
->firstOrCreate ([
58
53
'name ' => $ entity ,
59
54
]);
60
55
});
56
+ $ entities = (new Entity )->whereNotIn ('name ' , ['permission ' , 'entity ' ])->get ();
57
+ $ actions = (new Action )->all ();
61
58
$ ownerships = (new Ownership )->all ();
62
59
$ permissionMatrix = [];
63
60
You can’t perform that action at this time.
0 commit comments