protected function createForDriver($driver, array $config = [])
    {
        if (isset($this->customCreators[$driver])) {
            return $this->callCustom($driver, compact('config'));
        }

        if ($binding = $this->getBindingKeyForDriver($driver)) {
            return $this->resolveBinding($binding, compact('config'));
        }

        throw new InvalidArgumentException("Unsupported driver [$driver]");
    }
protected function createForDriver($driver, array $config = [])
    {
        if (isset($this->customCreators[$driver])) {
            return $this->callCustom($driver, compact('config'));
        }

        if ($binding = $this->getBindingKeyForDriver($driver)) {
            return $this->resolveBinding($binding, compact('config'));
        }

        throw new InvalidArgumentException("Unsupported driver [$driver]");
    }
protected function createForDriver ( $ driver , array $ config = [ ] ) { if ( isset ( $ this -> customCreators [ $ driver ] ) ) { return $ this -> callCustom ( $ driver , compact ( 'config' ) ) ; } if ( $ binding = $ this -> getBindingKeyForDriver ( $ driver ) ) { return $ this -> resolveBinding ( $ binding , compact ( 'config' ) ) ; } throw new InvalidArgumentException ( "Unsupported driver [$driver]" ) ; }
Create a new driver instance for the given driver.

We will check to see if a creator method exists for the given driver,
and will call the Closure if so, which allows us to have a more generic
resolver for the drivers themselves which applies to all connections.

@param  string  $driver
@param  array  $config
@return mixed

@throws \InvalidArgumentException
Create a new driver instance for the given driver .