diff --git a/src/Utility/Session.php b/src/Utility/Session.php index cc3dea5b..ee9d63de 100644 --- a/src/Utility/Session.php +++ b/src/Utility/Session.php @@ -1086,10 +1086,14 @@ public static function forget($key) } /** - * @return mixed + * @return boolean */ private static function hasRole() { - return UserAppRole::whereUserId(Session::getCurrentUserId())->exists(); + if(is_null(\Session::get('has_role'))){ + \Session::put('has_role', UserAppRole::whereUserId(Session::getCurrentUserId())->exists()); + } + + return \Session::get('has_role'); } } \ No newline at end of file