diff --git a/src/Traits/RevisionOptions.php b/src/Traits/RevisionOptions.php index 987ce14..0a77e89 100644 --- a/src/Traits/RevisionOptions.php +++ b/src/Traits/RevisionOptions.php @@ -44,6 +44,20 @@ class RevisionOptions */ public $defaultGetters = ['repeater' => 'getRepeater']; + /** + * If the model should be indexable + * + * @var bool + */ + public $isIndexable = false; + + /** + * Indexable keys + * + * @var array + */ + public $indexableKeys = []; + public static function create(): self { return new static(); @@ -51,9 +65,6 @@ public static function create(): self /** * Register affected types - * - * @param array $types - * @return self */ public function registerSpecialTypes(array $types): self { @@ -64,9 +75,6 @@ public function registerSpecialTypes(array $types): self /** * Register new getters - * - * @param array $getters - * @return self */ public function registerGetters(array $getters): self { @@ -77,9 +85,6 @@ public function registerGetters(array $getters): self /** * Register a default template - * - * @param string $slug - * @return self */ public function registerDefaultTemplate(string $slug): self { @@ -94,4 +99,12 @@ public function registerCacheTagsToFlush(array $tags): self return $this; } + + public function setSearchable(bool $searchable, array $indexableKeys = []): self + { + $this->isIndexable = $searchable; + $this->indexableKeys = $indexableKeys; + + return $this; + } }