class Illuminate / Database / ConnectionResolver

ConnectionResolver

Implements

Properties

protected

$connections Illuminate\...\ConnectionInterface[]

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