src/Checkers/Role/LaratrustRoleDefaultChecker.php
public function currentRoleCachedPermissions()
    {
        $cacheKey = 'laratrust_permissions_for_role_' . $this->role->getKey();

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

        return Cache::remember($cacheKey, Config::get('laratrust.cache.expiration_time', 60), function () {
            return $this->role->permissions()->get()->toArray();
        });
    }
public function currentRoleCachedPermissions()
    {
        $cacheKey = 'laratrust_permissions_for_role_' . $this->role->getKey();

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

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

@return \Illuminate\Database\Eloquent\Collection
Tries to return all the cached permissions of the role . If it can t bring the permissions from the cache it brings them back from the DB .