Cviebrock\LaravelElasticsearch\Manager::connection PHP Method

connection() public method

Retrieve or build the named connection.
public connection ( null $name = null ) : Elasticsearch\Client | mixed
$name null
return Elasticsearch\Client | mixed
    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];
    }