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;
    }