private function buildAttributesFromLdap($entry)
    {
        $this->attributes['dn']   = $entry['dn'];

        // Set the attributes accordingly to the search fields given
        foreach($entry as $index => $key){
            if(array_key_exists($index, config('ldap.search_fields'))){
                $this->attributes[$key] = isset($entry[$key][1]) ? $entry[$key] : $entry[$key][0];
            }
        };
    }