Manager
class Manager (View source)
Traits
CapsuleManagerTrait |
Properties
static protected object | $instance | The current globally used instance. | from CapsuleManagerTrait |
protected Container | $container | The container instance. | from CapsuleManagerTrait |
protected DatabaseManager | $manager | The database manager instance. |
Methods
void | setupContainer(Container $container) Setup the IoC container instance. | from CapsuleManagerTrait |
void | setAsGlobal() Make this capsule instance available globally. | from CapsuleManagerTrait |
Container | getContainer() Get the IoC container instance. | from CapsuleManagerTrait |
void | setContainer(Container $container) Set the IoC container instance. | from CapsuleManagerTrait |
void | __construct(Container $container = null) Create a new database capsule manager. | |
void | setupDefaultConfiguration() Setup the default database configuration options. | |
void | setupManager() Build the database manager instance. | |
static Connection | connection(string|null $connection = null) Get a connection instance from the global manager. | |
static Builder | table(Closure|Builder|string $table, string|null $as = null, string|null $connection = null) Get a fluent query builder instance. | |
static Builder | schema(string|null $connection = null) Get a schema builder instance. | |
Connection | getConnection(string|null $name = null) Get a registered connection instance. | |
void | addConnection(array $config, string $name = 'default') Register a connection with the manager. | |
void | bootEloquent() Bootstrap Eloquent so it is ready for usage. | |
$this | setFetchMode(int $fetchMode) Set the fetch mode for the database connections. | |
DatabaseManager | getDatabaseManager() Get the database manager instance. | |
Dispatcher|null | getEventDispatcher() Get the current event dispatcher instance. | |
void | setEventDispatcher(Dispatcher $dispatcher) Set the event dispatcher instance to be used by connections. | |
static mixed | __callStatic(string $method, array $parameters) Dynamically pass methods to the default connection. |
Details
protected void setupContainer(Container $container)
Setup the IoC container instance.
void setAsGlobal()
Make this capsule instance available globally.
Container getContainer()
Get the IoC container instance.
void setContainer(Container $container)
Set the IoC container instance.
void __construct(Container $container = null)
Create a new database capsule manager.
protected void setupDefaultConfiguration()
Setup the default database configuration options.
protected void setupManager()
Build the database manager instance.
static Connection connection(string|null $connection = null)
Get a connection instance from the global manager.
static Builder table(Closure|Builder|string $table, string|null $as = null, string|null $connection = null)
Get a fluent query builder instance.
static Builder schema(string|null $connection = null)
Get a schema builder instance.
Connection getConnection(string|null $name = null)
Get a registered connection instance.
void addConnection(array $config, string $name = 'default')
Register a connection with the manager.
void bootEloquent()
Bootstrap Eloquent so it is ready for usage.
$this setFetchMode(int $fetchMode)
Set the fetch mode for the database connections.
DatabaseManager getDatabaseManager()
Get the database manager instance.
Dispatcher|null getEventDispatcher()
Get the current event dispatcher instance.
void setEventDispatcher(Dispatcher $dispatcher)
Set the event dispatcher instance to be used by connections.
static mixed __callStatic(string $method, array $parameters)
Dynamically pass methods to the default connection.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Database/Capsule/Manager.html