protected function getMembersFromAttribute($attribute)
    {
        $members = [];

        $entries = $this->getAttribute($attribute) ?: [];

        $query = $this->query->newInstance();

        // Retrieving the member identifier to allow
        // compatibility with LDAP variants.
        $identifier = $this->schema->memberIdentifier();

        foreach ($entries as $entry) {
            // If our identifier is a distinguished name, then we need to
            // use an alternate query method, as we can't locate records
            // by distinguished names using an LDAP filter.
            if ($identifier == 'dn' || $identifier == 'distinguishedname') {
                $member = $query->findByDn($entry);
            } else {
                // We'll ensure we clear our filters when retrieving each member,
                // so we can continue fetching the next one in line.
                $member = $query->clearFilters()->findBy($identifier, $entry);
            }

            // We'll double check that we've received a model from
            // our query before adding it into our results.
            if ($member instanceof Model) {
                $members[] = $member;
            }
        }

        return $members;
    }
protected function getMembersFromAttribute($attribute)
    {
        $members = [];

        $entries = $this->getAttribute($attribute) ?: [];

        $query = $this->query->newInstance();

        // Retrieving the member identifier to allow
        // compatibility with LDAP variants.
        $identifier = $this->schema->memberIdentifier();

        foreach ($entries as $entry) {
            // If our identifier is a distinguished name, then we need to
            // use an alternate query method, as we can't locate records
            // by distinguished names using an LDAP filter.
            if ($identifier == 'dn' || $identifier == 'distinguishedname') {
                $member = $query->findByDn($entry);
            } else {
                // We'll ensure we clear our filters when retrieving each member,
                // so we can continue fetching the next one in line.
                $member = $query->clearFilters()->findBy($identifier, $entry);
            }

            // We'll double check that we've received a model from
            // our query before adding it into our results.
            if ($member instanceof Model) {
                $members[] = $member;
            }
        }

        return $members;
    }
protected function getMembersFromAttribute ( $ attribute ) { $ members = [ ] ; $ entries = $ this -> getAttribute ( $ attribute ) ? : [ ] ; $ query = $ this -> query -> newInstance ( ) ; // Retrieving the member identifier to allow // compatibility with LDAP variants. $ identifier = $ this -> schema -> memberIdentifier ( ) ; foreach ( $ entries as $ entry ) { // If our identifier is a distinguished name, then we need to // use an alternate query method, as we can't locate records // by distinguished names using an LDAP filter. if ( $ identifier == 'dn' || $ identifier == 'distinguishedname' ) { $ member = $ query -> findByDn ( $ entry ) ; } else { // We'll ensure we clear our filters when retrieving each member, // so we can continue fetching the next one in line. $ member = $ query -> clearFilters ( ) -> findBy ( $ identifier , $ entry ) ; } // We'll double check that we've received a model from // our query before adding it into our results. if ( $ member instanceof Model ) { $ members [ ] = $ member ; } } return $ members ; }
Retrieves group members by the specified model attribute.

@param $attribute

@return array
Retrieves group members by the specified model attribute .