protected function getConfig($name)
{
$name = $name ?: $this->getDefaultConnection();
// To get the database connection configuration, we will just pull each of the
// connection configurations and get the configurations for the given name.
// If the configuration doesn't exist, we'll throw an exception and bail.
$connections = $this->app['config']['lmongo::connections'];
if (is_null($config = array_get($connections, $name))) {
throw new \InvalidArgumentException("MongoDB [{$name}] not configured.");
}
return array_add($config, 'name', $name);
}