Skip to content

Commit 0077a65

Browse files
authored
UserDefaultChecker: use for fetching user roles (#699)
1 parent fdd83b1 commit 0077a65

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Checkers/User/UserDefaultChecker.php

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

155155
if (! Config::get('laratrust.cache.enabled')) {
156-
return $this->user->roles()->get()->toArray();
156+
return $this->user->getRelationValue('roles')->toArray();
157157
}
158158

159159
return Cache::remember($cacheKey, Config::get('laratrust.cache.expiration_time', 60), function () {
160-
return $this->user->roles()->get()->toArray();
160+
return $this->user->getRelationValue('roles')->toArray();
161161
});
162162
}
163163

0 commit comments

Comments
 (0)