/**
* Get the configuration array for a specific connection.
*
* @param string $connection The name of the connection.
*
* @return array
*
* @throws \InvalidArgumentException If connection is not defined
*/
public function getConnectionConfig($connection = null)
{
if ($connection === null) {
$connection = $this->defaultConnection;
}
$config = $this->config->get("database.connections.{$connection}");
if (!$config) {
if (!is_string($connection)) {
$connection = gettype($connection);
}
throw new \InvalidArgumentException("No config found for connection: {$connection}");
}
return $config;
}