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
Create a new engine manager instance.
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 50
__construct(Container $container, EngineOperationRunner $operationRunner)
Create a new engine manager instance.
at line 59
Engine
engine(string|null $name = null)
Get an engine instance by name.
at line 72
protected Engine
resolve(string $name)
Resolve the given engine.
at line 90
protected Engine
callCustomCreator(string $name)
Call a custom driver creator.
at line 100
AlgoliaEngine
createAlgoliaDriver()
Create an Algolia engine instance.
at line 119
protected void
ensureAlgoliaClientIsInstalled()
Ensure the Algolia client is installed.
at line 133
MeilisearchEngine
createMeilisearchDriver()
Create a Meilisearch engine instance.
at line 151
protected void
ensureMeilisearchClientIsInstalled()
Ensure the Meilisearch client is installed.
at line 167
TypesenseEngine
createTypesenseDriver()
Create a Typesense engine instance.
at line 185
protected void
ensureTypesenseClientIsInstalled()
Ensure the Typesense client is installed.
at line 199
CollectionEngine
createCollectionDriver()
Create a collection engine instance.
at line 207
DatabaseEngine
createDatabaseDriver()
Create a database engine instance.
at line 215
NullEngine
createNullDriver()
Create a null engine instance.
at line 226
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 240
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 254
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 264
string
getDefaultDriver()
Get the default Scout driver name.
at line 274
protected mixed
getConfig(string $key, mixed $default = null)
Get a Scout configuration value.