class DatabaseManager implements ConnectionResolverInterface mixin Connection (View source)
| Macroable |
| static protected array | $macros | The registered string macros. | from Macroable |
| protected Application | $app | The application instance. | |
| protected ConnectionFactory | $factory | The database connection factory instance. | |
| protected Connection> | $connections | The active connection instances. | |
| protected array<string,callable> | $extensions | The custom connection resolvers. | |
| protected callable | $reconnector | The callback to be executed to reconnect to a database. |
| static void | macro(string $name, object|callable $macro)
Register a custom macro. | from Macroable |
| static void | mixin(object $mixin, bool $replace = true)
Mix another object into the class. | from Macroable |
| static bool | hasMacro(string $name)
Checks if macro is registered. | from Macroable |
| static void | flushMacros()
Flush the existing macros. | from Macroable |
| static mixed | __callStatic(string $method, array $parameters)
Dynamically handle calls to the class. | from Macroable |
| mixed | __call(string $method, array $parameters)
Dynamically pass methods to the default connection. | |
| void | __construct(Application $app, ConnectionFactory $factory)
Create a new database manager instance. | |
| ConnectionInterface | connection(string|null $name = null)
Get a database connection instance. | |
| ConnectionInterface | connectUsing(string $name, array $config, bool $force = false)
Get a database connection instance from the given configuration. | |
| array | parseConnectionName(string $name)
Parse the connection into an array of the name and read / write type. | |
| Connection | makeConnection(string $name)
Make the database connection instance. | |
| array | configuration(string $name)
Get the configuration for a connection. | |
| Connection | configure(Connection $connection, string $type)
Prepare the database connection instance. | |
| void | dispatchConnectionEstablishedEvent(Connection $connection)
Dispatch the ConnectionEstablished event if the event dispatcher is available. | |
| Connection | setPdoForType(Connection $connection, string|null $type = null)
Prepare the read / write mode for database connection instance. | |
| void | purge(string|null $name = null)
Disconnect from the given database and remove from local cache. | |
| void | disconnect(string|null $name = null)
Disconnect from the given database. | |
| Connection | reconnect(string|null $name = null)
Reconnect to the given database. | |
| mixed | usingConnection(string $name, callable $callback)
Set the default database connection for the callback execution. | |
| Connection | refreshPdoConnections(string $name)
Refresh the PDO connections on a given connection. | |
| string | getDefaultConnection()
Get the default connection name. | |
| void | setDefaultConnection(string $name)
Set the default connection name. | |
| string[] | supportedDrivers()
Get all of the supported drivers. | |
| string[] | availableDrivers()
Get all of the drivers that are actually available. | |
| void | extend(string $name, callable $resolver)
Register an extension connection resolver. | |
| void | forgetExtension(string $name)
Remove an extension connection resolver. | |
| Connection> | getConnections()
Return all of the created connections. | |
| void | setReconnector(callable $reconnector)
Set the database reconnector callback. | |
| $this | setApplication(Application $app)
Set the application instance used by the manager. |
Register a custom macro.
Mix another object into the class.
Checks if macro is registered.
Flush the existing macros.
Dynamically handle calls to the class.
Dynamically pass methods to the default connection.
Create a new database manager instance.
Get a database connection instance.
Get a database connection instance from the given configuration.
Parse the connection into an array of the name and read / write type.
Make the database connection instance.
Get the configuration for a connection.
Prepare the database connection instance.
Dispatch the ConnectionEstablished event if the event dispatcher is available.
Prepare the read / write mode for database connection instance.
Disconnect from the given database and remove from local cache.
Disconnect from the given database.
Reconnect to the given database.
Set the default database connection for the callback execution.
Refresh the PDO connections on a given connection.
Get the default connection name.
Set the default connection name.
Get all of the supported drivers.
Get all of the drivers that are actually available.
Register an extension connection resolver.
Remove an extension connection resolver.
Return all of the created connections.
Set the database reconnector callback.
Set the application instance used by the manager.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Database/DatabaseManager.html