public function getPermissions(array $params = []): Collection
    {
        if ($this->permissions === null) {
            $this->permissions = $this->cache->remember(self::$cacheKey, self::$cacheExpirationTime, function () {
                return $this->getPermissionClass()
                    ->with('roles')
                    ->get();
            });
        }

        $permissions = clone $this->permissions;

        foreach ($params as $attr => $value) {
            $permissions = $permissions->where($attr, $value);
        }

        return $permissions;
    }
public function getPermissions(array $params = []): Collection
    {
        if ($this->permissions === null) {
            $this->permissions = $this->cache->remember(self::$cacheKey, self::$cacheExpirationTime, function () {
                return $this->getPermissionClass()
                    ->with('roles')
                    ->get();
            });
        }

        $permissions = clone $this->permissions;

        foreach ($params as $attr => $value) {
            $permissions = $permissions->where($attr, $value);
        }

        return $permissions;
    }
public function getPermissions ( array $ params = [ ] ) : Collection { if ( $ this -> permissions === null ) { $ this -> permissions = $ this -> cache -> remember ( self :: $ cacheKey , self :: $ cacheExpirationTime , function ( ) { return $ this -> getPermissionClass ( ) -> with ( 'roles' ) -> get ( ) ; } ) ; } $ permissions = clone $ this -> permissions ; foreach ( $ params as $ attr => $ value ) { $ permissions = $ permissions -> where ( $ attr , $ value ) ; } return $ permissions ; }
Get the permissions based on the passed params.

@param array $params

@return \Illuminate\Support\Collection
Get the permissions based on the passed params .