class Illuminate / Database / ConnectionResolver
You are viewing an older version of the documentation. For the latest, please visit master documentation.

ConnectionResolver

Implements

Properties

protected

$connections array

All of the registered connections.

Default: []
protected

$default string

The default connection name.

Default: null

Methods

public

__construct ( array $connections ) : void

Create a new connection resolver instance.

Parameters

  • $connections array
public

connection ( $name ) : ConnectionInterface

Get a database connection instance.

Parameters

  • $name string|null
public

addConnection ( $name , ConnectionInterface $connection ) : void

Add a connection to the resolver.

Parameters

public

hasConnection ( $name ) : bool

Check if a connection has been registered.

Parameters

  • $name string
public

getDefaultConnection ( ) : string

Get the default connection name.

public

setDefaultConnection ( $name ) : void

Set the default connection name.

Parameters

  • $name string