On this page
MultipleInstanceManager
abstract class MultipleInstanceManager (View source)
Properties
protected Application | $app | The application instance. |
|
protected array | $instances | The array of resolved instances. |
|
protected array | $customCreators | The registered custom instance creators. |
Methods
void | __construct(Application $app) Create a new manager instance. |
|
string | getDefaultInstance() Get the default instance name. |
|
void | setDefaultInstance(string $name) Set the default instance name. |
|
array | getInstanceConfig(string $name) Get the instance specific configuration. |
|
mixed | instance(string|null $name = null) Get an instance instance by name. |
|
mixed | get(string $name) Attempt to get an instance from the local cache. |
|
mixed | resolve(string $name) Resolve the given instance. |
|
mixed | callCustomCreator(array $config) Call a custom instance creator. |
|
$this | forgetInstance(array|string|null $name = null) Unset the given instances. |
|
void | purge(string|null $name = null) Disconnect the given instance and remove from local cache. |
|
$this | extend(string $name, Closure $callback) Register a custom instance creator Closure. |
|
mixed | __call(string $method, array $parameters) Dynamically call the default instance. |
Details
void __construct(Application $app)
Create a new manager instance.
abstract string getDefaultInstance()
Get the default instance name.
abstract void setDefaultInstance(string $name)
Set the default instance name.
abstract array getInstanceConfig(string $name)
Get the instance specific configuration.
mixed instance(string|null $name = null)
Get an instance instance by name.
protected mixed get(string $name)
Attempt to get an instance from the local cache.
protected mixed resolve(string $name)
Resolve the given instance.
protected mixed callCustomCreator(array $config)
Call a custom instance creator.
$this forgetInstance(array|string|null $name = null)
Unset the given instances.
void purge(string|null $name = null)
Disconnect the given instance and remove from local cache.
$this extend(string $name, Closure $callback)
Register a custom instance creator Closure.
mixed __call(string $method, array $parameters)
Dynamically call the default instance.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/10.x/Illuminate/Support/MultipleInstanceManager.html