Skip to content

Commit 40bd3cd

Browse files
committed
Revert #699
1 parent e5a5043 commit 40bd3cd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/Checkers/User/UserDefaultChecker.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ protected function userCachedRoles(): array
157157
$cacheKey = 'laratrust_roles_for_'.$this->userModelCacheKey().'_'.$this->user->getKey();
158158

159159
if (! Config::get('laratrust.cache.enabled')) {
160-
return $this->user->getRelationValue('roles')->toArray();
160+
return $this->user->roles()->get()->toArray();
161161
}
162162

163163
return Cache::remember($cacheKey, Config::get('laratrust.cache.expiration_time', 60), function () {
164-
return $this->user->getRelationValue('roles')->toArray();
164+
return $this->user->roles()->get()->toArray();
165165
});
166166
}
167167

@@ -175,11 +175,11 @@ public function userCachedPermissions(): array
175175
$cacheKey = 'laratrust_permissions_for_'.$this->userModelCacheKey().'_'.$this->user->getKey();
176176

177177
if (! Config::get('laratrust.cache.enabled')) {
178-
return $this->user->getRelationValue('permissions')->toArray();
178+
return $this->user->permissions()->get()->toArray();
179179
}
180180

181181
return Cache::remember($cacheKey, Config::get('laratrust.cache.expiration_time', 60), function () {
182-
return $this->user->getRelationValue('permissions')->toArray();
182+
return $this->user->permissions()->get()->toArray();
183183
});
184184
}
185185

0 commit comments

Comments
 (0)