Laratrust\Traits\LaratrustUserTrait::cachedPermissions PHP Method

cachedPermissions() public method

Tries to return all the cached permissions of the user and if it can't bring the permissions from the cache, it would bring them back from the DB
public cachedPermissions ( ) : Illuminate\Database\Eloquent\Collection
return Illuminate\Database\Eloquent\Collection
    public function cachedPermissions()
    {
        $cacheKey = 'laratrust_permissions_for_user_' . $this->getKey();
        return Cache::remember($cacheKey, Config::get('cache.ttl', 60), function () {
            return $this->permissions()->get();
        });
    }