src/Checkers/User/LaratrustUserDefaultChecker.php
protected function userCachedRoles()
    {
        $cacheKey = 'laratrust_roles_for_user_' . $this->user->getKey();

        if (!Config::get('laratrust.cache.enabled')) {
            return $this->user->roles()->get();
        }

        return Cache::remember($cacheKey, Config::get('laratrust.cache.expiration_time', 60), function () {
            return $this->user->roles()->get()->toArray();
        });
    }
protected function userCachedRoles()
    {
        $cacheKey = 'laratrust_roles_for_user_' . $this->user->getKey();

        if (!Config::get('laratrust.cache.enabled')) {
            return $this->user->roles()->get();
        }

        return Cache::remember($cacheKey, Config::get('laratrust.cache.expiration_time', 60), function () {
            return $this->user->roles()->get()->toArray();
        });
    }
protected function userCachedRoles ( ) { $ cacheKey = 'laratrust_roles_for_user_' . $ this -> user -> getKey ( ) ; if ( ! Config :: get ( 'laratrust.cache.enabled' ) ) { return $ this -> user -> roles ( ) -> get ( ) ; } return Cache :: remember ( $ cacheKey , Config :: get ( 'laratrust.cache.expiration_time' , 60 ) , function ( ) { return $ this -> user -> roles ( ) -> get ( ) -> toArray ( ) ; } ) ; }
Tries to return all the cached roles of the user.
If it can't bring the roles from the cache,
it brings them back from the DB.

@param \Illuminate\Database\Eloquent\Model $model
@return \Illuminate\Database\Eloquent\Collection
Tries to return all the cached roles of the user . If it can t bring the roles from the cache it brings them back from the DB .