protected function addProviders(Adldap $adldap, array $connections = [])
    {
        // Go through each connection and construct a Provider.
        foreach ($connections as $name => $config) {
            // Create a new provider.
            $provider = $this->newProvider(
                $config['settings'],
                new $config['connection']
            );

            if ($this->shouldAutoConnect($config)) {
                try {
                    $provider->connect();
                } catch (BindException $e) {
                    // We'll catch and log bind exceptions so
                    // any connection issues fail gracefully
                    // in our application.
                    logger()->error($e);
                }
            }

            // Add the provider to the Adldap container.
            $adldap->addProvider($provider, $name);
        }

        return $adldap;
    }
protected function addProviders(Adldap $adldap, array $connections = [])
    {
        // Go through each connection and construct a Provider.
        foreach ($connections as $name => $config) {
            // Create a new provider.
            $provider = $this->newProvider(
                $config['settings'],
                new $config['connection']
            );

            if ($this->shouldAutoConnect($config)) {
                try {
                    $provider->connect();
                } catch (BindException $e) {
                    // We'll catch and log bind exceptions so
                    // any connection issues fail gracefully
                    // in our application.
                    logger()->error($e);
                }
            }

            // Add the provider to the Adldap container.
            $adldap->addProvider($provider, $name);
        }

        return $adldap;
    }
protected function addProviders ( Adldap $ adldap , array $ connections = [ ] ) { // Go through each connection and construct a Provider. foreach ( $ connections as $ name => $ config ) { // Create a new provider. $ provider = $ this -> newProvider ( $ config [ 'settings' ] , new $ config [ 'connection' ] ) ; if ( $ this -> shouldAutoConnect ( $ config ) ) { try { $ provider -> connect ( ) ; } catch ( BindException $ e ) { // We'll catch and log bind exceptions so // any connection issues fail gracefully // in our application. logger ( ) -> error ( $ e ) ; } } // Add the provider to the Adldap container. $ adldap -> addProvider ( $ provider , $ name ) ; } return $ adldap ; }
Adds providers to the specified Adldap instance.

If a provider is configured to auto connect,
this method will throw a BindException.

@param Adldap $adldap
@param array  $connections

@throws \Adldap\Auth\BindException

@return Adldap
Adds providers to the specified Adldap instance .