File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 5
5
use Backpack \CRUD \app \Http \Controllers \CrudController ;
6
6
use Backpack \PermissionManager \app \Http \Requests \PermissionStoreCrudRequest as StoreRequest ;
7
7
use Backpack \PermissionManager \app \Http \Requests \PermissionUpdateCrudRequest as UpdateRequest ;
8
+ use Spatie \Permission \PermissionRegistrar ;
8
9
9
10
// VALIDATION
10
11
@@ -62,7 +63,7 @@ public function setupCreateOperation()
62
63
$ this ->crud ->setValidation (StoreRequest::class);
63
64
64
65
//otherwise, changes won't have effect
65
- \Cache:: forget ( ' spatie.permission.cache ' );
66
+ app ()-> make (PermissionRegistrar::class)-> forgetCachedPermissions ( );
66
67
}
67
68
68
69
public function setupUpdateOperation ()
@@ -71,7 +72,7 @@ public function setupUpdateOperation()
71
72
$ this ->crud ->setValidation (UpdateRequest::class);
72
73
73
74
//otherwise, changes won't have effect
74
- \Cache:: forget ( ' spatie.permission.cache ' );
75
+ app ()-> make (PermissionRegistrar::class)-> forgetCachedPermissions ( );
75
76
}
76
77
77
78
private function addFields ()
Original file line number Diff line number Diff line change 5
5
use Backpack \CRUD \app \Http \Controllers \CrudController ;
6
6
use Backpack \PermissionManager \app \Http \Requests \RoleStoreCrudRequest as StoreRequest ;
7
7
use Backpack \PermissionManager \app \Http \Requests \RoleUpdateCrudRequest as UpdateRequest ;
8
+ use Spatie \Permission \PermissionRegistrar ;
8
9
9
10
// VALIDATION
10
11
@@ -104,7 +105,7 @@ public function setupCreateOperation()
104
105
$ this ->crud ->setValidation (StoreRequest::class);
105
106
106
107
//otherwise, changes won't have effect
107
- \Cache:: forget ( ' spatie.permission.cache ' );
108
+ app ()-> make (PermissionRegistrar::class)-> forgetCachedPermissions ( );
108
109
}
109
110
110
111
public function setupUpdateOperation ()
@@ -113,7 +114,7 @@ public function setupUpdateOperation()
113
114
$ this ->crud ->setValidation (UpdateRequest::class);
114
115
115
116
//otherwise, changes won't have effect
116
- \Cache:: forget ( ' spatie.permission.cache ' );
117
+ app ()-> make (PermissionRegistrar::class)-> forgetCachedPermissions ( );
117
118
}
118
119
119
120
private function addFields ()
You can’t perform that action at this time.
0 commit comments