From 1c0e571f24e23fc9c7e5c035f255036077e8dd1e Mon Sep 17 00:00:00 2001 From: Julian Hundeloh Date: Thu, 29 Jul 2021 15:51:07 +0200 Subject: [PATCH] fix: accept callable for search config option --- src/PostgresEngine.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/PostgresEngine.php b/src/PostgresEngine.php index b92b3e0..9e343e5 100644 --- a/src/PostgresEngine.php +++ b/src/PostgresEngine.php @@ -529,7 +529,13 @@ protected function preserveModel(Model $model) */ protected function searchConfig(Model $model) { - return $this->option($model, 'config', $this->config('config', '')) ?: null; + $searchConfig = $this->option($model, 'config', $this->config('config', '')); + + if (is_callable($searchConfig)) { + $searchConfig = $searchConfig($model); + } + + return $searchConfig; } /**