Skip to content

Commit d42cbd2

Browse files
authored
Add __call() method to AlgoliaEngine
This allows calling the Algolia search client's methods like `multipleQueries()` easily.
1 parent 1e22f8e commit d42cbd2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Engines/AlgoliaEngine.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,16 @@ protected function usesSoftDelete($model)
228228
{
229229
return in_array(SoftDeletes::class, class_uses_recursive($model));
230230
}
231+
232+
/**
233+
* Dynamically call the Algolia client instance.
234+
*
235+
* @param string $method
236+
* @param array $parameters
237+
* @return mixed
238+
*/
239+
public function __call($method, $parameters)
240+
{
241+
return $this->algolia->$method(...$parameters);
242+
}
231243
}

0 commit comments

Comments
 (0)