diff --git a/src/Engines/TypesenseEngine.php b/src/Engines/TypesenseEngine.php index 2f79954d..ecea37a5 100644 --- a/src/Engines/TypesenseEngine.php +++ b/src/Engines/TypesenseEngine.php @@ -501,6 +501,10 @@ protected function getOrCreateCollectionFromModel($model): TypesenseCollection } catch (ObjectNotFound $exception) { $schema = config('scout.typesense.model-settings.'.get_class($model).'.collection-schema') ?? []; + if (method_exists($model, 'typesenseCollectionSchema')) { + $schema = $model->typesenseCollectionSchema(); + } + if (! isset($schema['name'])) { $schema['name'] = $model->searchableAs(); }