public function connection($name = null) { $name = $name ?: $this->getDefaultConnection(); if (!isset($this->connections[$name])) { $client = $this->makeConnection($name); $this->connections[$name] = $client; } return $this->connections[$name]; }