EngineManager
class EngineManager
Manages search engine instances and driver creation.
EngineManager is auto-singletoned by the container, so its instance cache is shared across coroutines for the worker lifetime.
Properties
| protected Engine> | $engines | The resolved engine instances. |
|
| protected Closure> | $customCreators | The registered custom driver creators. |
Methods
Call a custom driver creator.
Create an Algolia engine instance.
Ensure the Algolia client is installed.
Create a Meilisearch engine instance.
Ensure the Meilisearch client is installed.
Create a Typesense engine instance.
Ensure the Typesense client is installed.
Create a collection engine instance.
Create a database engine instance.
Create a null engine instance.
Forget all of the resolved engine instances.
Forget a specific resolved engine instance.
Get the default Scout driver name.
Get a Scout configuration value.
Details
at line 49
__construct(Container $container)
Create a new engine manager instance.
at line 57
Engine
engine(string|null $name = null)
Get an engine instance by name.
at line 69
protected Engine
resolve(string $name)
Resolve the given engine.
at line 87
protected Engine
callCustomCreator(string $name)
Call a custom driver creator.
at line 97
AlgoliaEngine
createAlgoliaDriver()
Create an Algolia engine instance.
at line 113
protected void
ensureAlgoliaClientIsInstalled()
Ensure the Algolia client is installed.
at line 127
MeilisearchEngine
createMeilisearchDriver()
Create a Meilisearch engine instance.
at line 142
protected void
ensureMeilisearchClientIsInstalled()
Ensure the Meilisearch client is installed.
at line 158
TypesenseEngine
createTypesenseDriver()
Create a Typesense engine instance.
at line 173
protected void
ensureTypesenseClientIsInstalled()
Ensure the Typesense client is installed.
at line 187
CollectionEngine
createCollectionDriver()
Create a collection engine instance.
at line 195
DatabaseEngine
createDatabaseDriver()
Create a database engine instance.
at line 203
NullEngine
createNullDriver()
Create a null engine instance.
at line 214
EngineManager
extend(string $driver, Closure $callback)
Register a custom driver creator.
Boot-only. The callback persists in the singleton's customCreators array for the worker lifetime and applies to every subsequent engine resolution.
at line 228
EngineManager
forgetEngines()
Forget all of the resolved engine instances.
Boot or tests only. Clears the manager's engine cache; concurrent coroutines may already hold references that next resolution will not share.
at line 242
EngineManager
forgetEngine(string $name)
Forget a specific resolved engine instance.
Boot or tests only. Mutates the manager's engine cache; concurrent coroutines may already hold a reference to the engine and next resolution will rebuild.
at line 252
string
getDefaultDriver()
Get the default Scout driver name.
at line 262
protected mixed
getConfig(string $key, mixed $default = null)
Get a Scout configuration value.