From 71d97475f39a155721e26c06f70f45e0791d9fc0 Mon Sep 17 00:00:00 2001 From: Will Taylor-Jackson Date: Mon, 28 Jan 2019 20:51:45 +0000 Subject: [PATCH 1/2] feat: method to set the search index --- src/Searchable.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Searchable.php b/src/Searchable.php index 889c813..393577f 100644 --- a/src/Searchable.php +++ b/src/Searchable.php @@ -19,6 +19,16 @@ public function getSearchIndex() return $this->searchIndex ?? $this->getTable(); } + /** + * Set the index this model is to be added to + * + * @param string + */ + public function setSearchIndex(string $index) + { + return $this->searchIndex = $index; + } + /** * Get the search type associated with the model. * From 8f690fe99eac6acbf7031eadcde25378572d3b00 Mon Sep 17 00:00:00 2001 From: Will Taylor-Jackson Date: Tue, 29 Jan 2019 09:42:12 +0000 Subject: [PATCH 2/2] refactor: return $this --- src/Searchable.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Searchable.php b/src/Searchable.php index 393577f..7ea4ead 100644 --- a/src/Searchable.php +++ b/src/Searchable.php @@ -22,11 +22,14 @@ public function getSearchIndex() /** * Set the index this model is to be added to * - * @param string + * @param string + * @return self */ public function setSearchIndex(string $index) { - return $this->searchIndex = $index; + $this->searchIndex = $index; + + return $this; } /**